Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the OpenRC init script and conf file #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orlitzky
Copy link
Contributor

The commit message does some explaining. We've had this patch in Gentoo for a long time. While I hate to use this argument, I'm the Gentoo maintainer for ndoutils, and I wrote the OpenRC service script guide, so unless you know someone else who uses OpenRC, you should probably just trust me :)

This commit largely rewrites the OpenRC init script with the goal of
simplifying it. The end result should be functionally the same, but is
much shorter. The changes are as follows:

 1. Replace the deprecated /sbin/runscript shebang with /sbin/openrc-run.

 2. Replace the existing dependencies with "need mysql nagios". The
    ndo2db daemon needs Nagios to create the TCP or Unix socket over
    which it will communicate, and obviously it needs mysql to be
    up and running in order to save any data. The dependencies
    of mysql and nagios themselves will bring up whatever else is
    required; nothing else needs to be listed as a dependency of
    ndo2db.

 3. Use the "command", "command_args", and "pidfile" OpenRC
    variables. OpenRC is smart enough to start and stop a well-behaved
    daemon on its own without a custom start/stop function. By
    specifying those three variables, we are able to eliminate much of
    the custom start/stop code in the init script.

Finally, the default value of NDO2DB_CFG in the associated conf file has
been updated to use @sysconfdir@ instead of @pkgsysconfdir@, which wasn't
having any effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant