On 2014/02/28 08:07, Antoine Jacoutot wrote:
> On Thu, Feb 27, 2014 at 09:05:06PM -0500, [email protected] wrote:
> > Hello,
> >
> > I'm running spampd, installed from package snapshots (Feb 25) on the Feb 24
> > amd64 snapshot of 5.5.
> >
> > It's working fine with postfix, and starts and stops fine interactively with
> > /etc/rc.d/spampd stop, start.
> >
> > I can't seem to work through yet an issue when starting it on a reboot. It
> > seems to start then immediately receives a HUP and dies, looking for the pid
> > file in the wrong (default) location.
> >
> > I've customized the flags in my /etc/rc.d/spampd:
>
> 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
> > 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
> > . /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.