nagios-statd does not appear to by default create a pidfile (or not in the location the rc script expects). Starting nagios-statd via /usr/local/etc/rc.d/nagiosstatd will therefore launch the daemon, but not create a PIDfile. This in turn means that attempting to start or restart the daemon via the RC script will fail, as it does not detect a running instance. How-To-Repeat: $ /var/run$ /usr/local/etc/rc.d/nagiosstatd start Starting nagiosstatd. $ ps auxwww | grep statd root 68885 0.0 0.2 5140 3696 ?? Ss 11:30AM 0:00.04 python /usr/local/sbin/nagios-statd $ ls /var/run/nagiosstatd.pid ls: /var/run/nagiosstatd.pid: No such file or directory $ /var/run$ /usr/local/etc/rc.d/nagiosstatd restart nagiosstatd not running? Starting nagiosstatd. Port 1040 is already in use. Unable to bind - exiting. Manually adding a "-P /var/run/nagiosstatd.d" will create the pidfile, but a stop/restart will still complain that the daemon is not running (even when it is, and the pidfile contains a valid process-id for statd)
Responsible Changed From-To: freebsd-bugs->freebsd-ports-bugs reassign to ports team
Dear maintainer of sysutils/nagios-statd, a problem report has been submitted for your port for which your feedback might be required; its contents can be found at [1]. If it contains a patch or suggestions for a change, please send a followup to the PR explaining whether or not you approve it and want it to be committed. Regards, Stefan [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/127444
Responsible Changed From-To: freebsd-ports-bugs->stefan Take.
Hi Tyler, there hasn't been a reply by the maintainer of sysutils/nagios-statd, yet. Can you provide a patch with changes that fix the problem you reported? Regards, Stefan
Maintainer replied in private mail: Jim Shewmaker, 21.10.08, 17:25h CEST: > Hi Stefan, > > I am traveling out of the country and haven't had a chance to look at > it yet. I should have sometime time tomorrow to hopefully finish a > patch (assuming the description is valid). thanks. > > Regards, > > Jim Shewmaker
Submitter replied in private mail: Aviss, Tyler, 21.10.08, 19:42h CEST: > I have a modified/hacked-up version of the RC script. I've been running > into another bug more recently though. Even when statd is terminated and > the process is no longer running, sometimes it hangs on to the port for > awhile which causes a new instance to fail on restart. I tried to add a > few "sleep" lines to avoid this, but how long it holds on seems random > up to a minute or sometimes a bit more. > > I'll see if I can dig up the modified script, though your mileage may vary. > > > - TJA
Hi Tyler, hi Jim, there hasn't been a followup to this PR [1] for a while. Any news on this issue? Regards, Stefan [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=127444
Submitter replied in private mail: Tyler Aviss, 10.12.08, 16:23h CET: > Hmm. Well my modifications are definitely an outright "hack" (although > hatchet-job might be more description) of the RC file, so I wouldn't > want to put them up here even though they do work. > > Basically adding a -P ${pidfile} to the flags, and having it read that > file on a "stop" then kill the associated process will work. A restart > is tricky though, since (on my boxes at least) nagios sometimes takes > quite awhile to release the port even after being killed, in which case > you need to do a sleep between the stop and start. The time for this > varies though... I'm not sure why. > > - TJA
Hi Tyler, hi Jim, I finally had a bit of time to look for the problem in the rc script. Can you two please verify that the attached patch fixes the problem? The definition of $pidfile in the script referenced another variable that didn't exist, and it's necessary to set $command_interpreter here because the daemon process is a Python script. I didn't see any problems with 'restart' here. If this fix works for you, I'll commit it. Best regards, Stefan
stefan 2009-01-28 11:58:14 UTC FreeBSD ports repository Modified files: sysutils/nagios-statd Makefile sysutils/nagios-statd/files nagiosstatd.sh.in Log: Fix stopping the daemon via rc script by properly setting $pidfile and $command_interpreter. PR: 127444 Submitted by: Tyler Aviss <a-freebsd@phormix.com> Patch by: stefan Revision Changes Path 1.6 +1 -0 ports/sysutils/nagios-statd/Makefile 1.2 +3 -1 ports/sysutils/nagios-statd/files/nagiosstatd.sh.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Patch committed. Thanks for your report!