Antoine Jacoutot wrote:
Don't. Use rc.conf.local as explained in rc.d(8).
Ok;

Feb 27 14:01:54 mx2 spampd[22950]: 2014/02/27-14:01:54 Couldn't open pid
file "/var/run/spampd.pid" [Permission denied].  at line 180 in file
/usr/local/libdata/perl5/site_perl/Net/Server.pm

Looks like the pid file is not properly removed.
Except the .pid should never actually have been there due to the --p flag;

Can you drop the '--p=' option and see if it helps.


(/etc/rc.d/spampd - restored to original):

...
daemon_flags="--tagall --aw"
...

(spampd flags in /etc/rc.conf.local):

spampd_flags="--a --rh --p=/var/spampd/spampd.pid --relayport=10026"

(after reboot):

Feb 28 09:21:48 mx2 spampd[24108]: Process Backgrounded
Feb 28 09:21:48 mx2 spampd[24108]: 2014/02/28-09:21:48 SpamPD (type Net::Server::PreForkSimple) starting! pid(24108) Feb 28 09:21:48 mx2 spampd[24108]: Binding to TCP port 10025 on host 127.0.0.1 with IPv4
Feb 28 09:21:48 mx2 spampd[24108]: Setting gid to "731 731"
Feb 28 09:21:48 mx2 spampd[24108]: Setting uid to "731"
Feb 28 09:21:48 mx2 spampd[24108]: Received a SIG HUP
Feb 28 09:21:48 mx2 spampd[24108]: 2014/02/28-09:21:48 Server closing!
Feb 28 09:21:48 mx2 spampd[24108]: 2014/02/28-09:21:48 Re-exec server during HUP Feb 28 09:21:51 mx2 spampd[24108]: Pid_file created by this same process. Doing nothing. Feb 28 09:21:51 mx2 spampd[24108]: Pid_file created by this same process. Doing nothing. Feb 28 09:21:51 mx2 spampd[24108]: 2014/02/28-09:21:51 SpamPD (type Net::Server::PreForkSimple) starting! pid(24108)
Feb 28 09:21:51 mx2 spampd[24108]: Binding open file descriptors
Feb 28 09:21:51 mx2 spampd[24108]: Binding to TCP port 10025 on host 127.0.0.1 with IPv4
Feb 28 09:21:51 mx2 spampd[24108]: Setting gid to "731 731"


So this solves the reboot issue.
It seems that on startup, spampd starts first with default flags (not even what's in your /etc/rc.d/spampd), and then gets a HUP (from where?) and restarts with the passed flags.

However, with the .pid being in the original, default location, the original problem returned which led me to moving the pid. The rc script no longer will stop or restart the daemon:

# /etc/rc.d/spampd restart
spampd(failed)

produces:

Feb 28 09:28:47 mx2 spampd[30125]: Pid_file already exists for running process (24108)... aborting Feb 28 09:28:47 mx2 spampd[30125]: 2014/02/28-09:28:47 at line 145 in file /usr/local/libdata/perl5/site_perl/Net/Server.pm
Feb 28 09:28:47 mx2 spampd[30125]: 2014/02/28-09:28:47 Server closing!

And then the original processes continue to run ignoring stop, restart, etc.. This is mainly an issue because the daemon is supposed to be restarted after the sa rules are updated.

Thanks again,
Andrew






Reply via email to