-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Put nrpe pidfile dirctly into the usual run directory - Fixes #7 #41
Conversation
Well, the pidfile needs to point to path that appropriate system initscript uses. Also, in my system, i found that i needed separate dir, because daemon runs as nagios user and that user can not write to /var/run, so i created /var/run/nrpe dir in that system. |
which os/distro are you using? i'm using ubuntu 12.04 and only root can write to /var/run. Also nrpe runs as nagios user, but i think it creates the pid file still as root and afterwards does the daemon fork magic. |
i run pld linux, but no, it fails to reload if using /var/run. the change itself is very old, so i do not have log. but i'm very sure it was during shutdown it was unable to remove pidfile with nagios user pld-linux/nagios-nrpe@ce845d3 |
ok, maybe it would make sense if the pid_dir is created within the init script? this script at least should run as root, so it will have the privileges to do so? |
not knowing your system, but seeing the diff, i would say if you stay with /var/run/nagios dir, it should work fine. because:
also, recipe may add 'directory "/var/run/nagios"' resource (with proper nagios-writable permissions) if the dir does not exist. |
looked the PR diff again. you shouldn't modify 'freebsd' case, if you don't know or can test that system! |
ahh ok, i'm running this cookbook with the source install method, then the /var/run/nagios does not exist for me. also after any reboot the /var/run directory is cleaned again. so even if chef creates the directory , i must ensure it runs after a reboot, which is not the case for me. ok with the freebsd a totally agree |
and for the fix for #7, are you sure debian initscript has "reload" action? maybe you need :restart instead?
this is from my system and it lacks reload, because nrpe daemon itself does not handle any signals |
hmm so this cookbook provides an init script ... and it also supports the reload command https://github.com/schubergphilis/nrpe/blob/master/templates/default/nagios-nrpe-server.erb#L54 |
i assume you run /var/run as tmpfs and systemd? so you need systemd-tmpfiles configuration so the dir is created at boot. |
if initscript comes from recipe, you can then mkdir in initscript in 'start' action. more universal than systemd config, i guess.
|
oo, it has signals support indeed. but test whether it actually reloads configuration?
|
Hi @5c077yP I am trying to fix the travis issues in this cookbook and going over all open PRs either failed in travis CI or did not even run Travis. Do you think that this PR is still valid and required? |
@snkutlu hmm, this PR is quite some time ago, let me think that through again |
If you want to pick this up again, just raise a new PR. 👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey,
this PR tries to fix #7 . As described there , the nrpe daemon can't be reloaded properly, because the pid file was not created. It seems nrpe is not creating the pid file if the directory does not exist. Unfortunately the init script does not fail and so it's not properly reported to the chef run. With this PR the pid file is put directly into the usual run dir (which should always exist) and not in a separated pid directory.