Stuart Henderson wrote:
Don't.
Use rc.conf.local as explained in rc.d(8).
Yes - I wonder if we should rename daemon_flags to
do_not_edit_this_directly_use_rc_conf_local_instead___daemon_flags
So you would want to revert the change to /etc/rc.d/spampd, and
instead use spampd_flags="....." in rc.conf.local
Done; my latest results in previous post;
daemon="/usr/local/sbin/spampd"
daemon_flags="--a --rh --p=/var/spampd/spampd.pid --relayport=10026"
-- is for long options, - for short options, maybe you should have
this instead:
-a -rh -p=/var/spampd/spampd.pid --relayport=10026
I understand, except for spampd, according to the man page, this isn't
the case, it takes short options with --
. /etc/rc.d/rc.subr
pexp="/usr/bin/perl -T ${daemon}${daemon_flags:+ ${daemon_flags}}"
rc_cmd $1
On a reboot, I get this behaviour:
Feb 27 14:01:49 mx2 spampd[22950]: Process Backgrounded
Feb 27 14:01:49 mx2 spampd[22950]: 2014/02/27-14:01:49 SpamPD (type
Net::Server::PreForkSimple) starting! pid(22950)
Feb 27 14:01:49 mx2 spampd[22950]: Binding to TCP port 10025 on host
127.0.0.1 with IPv4
Feb 27 14:01:49 mx2 spampd[22950]: Setting gid to "731 731"
Feb 27 14:01:49 mx2 spampd[22950]: Setting uid to "731"
Feb 27 14:01:50 mx2 spampd[22950]: Received a SIG HUP
Not sure but I wonder if this is just something that
Net::Server::PreForkSimple does anyway.
Feb 27 14:01:50 mx2 spampd[22950]: 2014/02/27-14:01:50 Server closing!
Feb 27 14:01:51 mx2 spampd[22950]: 2014/02/27-14:01:51 Re-exec server during
HUP
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
Here it's trying to write to /var/run/spampd.pid so it's ignoring
the option to write to /var/spampd/spampd.pid.
Exactly. I found this. It's not exactly helpful but seems to indicate
that there's something buggy in it.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602275