Mailing List Archive

spfd FreeBSD rc.d script
Hello all,

I checked the archives and there was a rumbling not long
back about an rc.d script - did anyone get any further
with this?

I hacked up a VERY basic one using rc_subr but of course
it's hindered by the simple fact that spfd doesn't record
it's PID anywhere.

It basically means you can't tell if the daemon is already
running, which is fairly bad with the Exim ACL since it
defers all mail when it can't connect to the spfd socket.

The solution I expect would be the same as with Clamd or
something similar - run a cron job every now and again
to check if spfd is still running under the pid it last
recorded, and restart it if necessary.

So two questions, then! Anyone up for adding pidfile
support for spfd, and when someone does that, does anyone
want to write a script to check if it's still running
so we can run that cron job? (rc_subr has this built-in
as long as there is a pidfile). I must admit I'm not
talented enough to do either, Perl is something I
gave up on a long time ago ;)

Thanks,

--
Matt Sealey <matt@genesi.co.uk>
Genesi, Manager, Developer Relations

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: spfd FreeBSD rc.d script [ In reply to ]
On Wed, 26 May 2004, Matt Sealey wrote:

> I checked the archives and there was a rumbling not long
> back about an rc.d script - did anyone get any further
> with this?
>
> I hacked up a VERY basic one using rc_subr but of course
> it's hindered by the simple fact that spfd doesn't record
> it's PID anywhere.
>
> It basically means you can't tell if the daemon is already
> running, which is fairly bad with the Exim ACL since it
> defers all mail when it can't connect to the spfd socket.
>
> The solution I expect would be the same as with Clamd or
> something similar - run a cron job every now and again
> to check if spfd is still running under the pid it last
> recorded, and restart it if necessary.
>
> So two questions, then! Anyone up for adding pidfile
> support for spfd, and when someone does that, does anyone
> want to write a script to check if it's still running
> so we can run that cron job? (rc_subr has this built-in
> as long as there is a pidfile). I must admit I'm not
> talented enough to do either, Perl is something I
> gave up on a long time ago ;)

I wrote one for gentoo but I don't recall having to do that dance with it.

In fact, it's short enough to attach here in the hope that someone puts it
somewhere sensible. The copyright is merely an inconvenience, of course,
since it contains no intellectual material whatsoever. Feel free.

S.

--

#!/sbin/runscript
# Copyright 1999-2003 Shevek
# Distributed under the terms of the GNU General Public License, v2 or later

# NB: Config is in /etc/conf.d/spfd

depend() {
need net
}

start() {
ebegin "Starting spfd"
start-stop-daemon --start --background \
--exec /usr/bin/spfd -- ${SPFD_OPTS}
eend $? "Failed to start spfd"
}

stop() {
ebegin "Stopping spfd"
start-stop-daemon --stop --quiet --name spfd
eend $? "Failed to stop spfd"
}


--

and /etc/conf.d/spfd:

--

# usage: spfd ( -port=5970 | -path=/var/spfd )
# [-user=(uid|username)] [-group=(gid|groupname)]

SPFD_OPTS="-path=/tmp/spfd -user=mail -group=mail"

--
Shevek http://www.anarres.org/
I am the Borg. http://www.gothnicity.org/

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: spfd FreeBSD rc.d script [ In reply to ]
Hi,

Maybe this is a stupid suggestion, but as long is there is no pid-file how about ps+grep?

Koen

On Wed, May 26, 2004 at 07:31:38PM +0100, Matt Sealey wrote:
>
> Hello all,
>
> I checked the archives and there was a rumbling not long
> back about an rc.d script - did anyone get any further
> with this?
>
> I hacked up a VERY basic one using rc_subr but of course
> it's hindered by the simple fact that spfd doesn't record
> it's PID anywhere.
>
> It basically means you can't tell if the daemon is already
> running, which is fairly bad with the Exim ACL since it
> defers all mail when it can't connect to the spfd socket.
>
> The solution I expect would be the same as with Clamd or
> something similar - run a cron job every now and again
> to check if spfd is still running under the pid it last
> recorded, and restart it if necessary.
>
> So two questions, then! Anyone up for adding pidfile
> support for spfd, and when someone does that, does anyone
> want to write a script to check if it's still running
> so we can run that cron job? (rc_subr has this built-in
> as long as there is a pidfile). I must admit I'm not
> talented enough to do either, Perl is something I
> gave up on a long time ago ;)
>
> Thanks,
>
> --
> Matt Sealey <matt@genesi.co.uk>
> Genesi, Manager, Developer Relations
>
> -------
> To unsubscribe, change your address, or temporarily deactivate your subscription,
> please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com

--
gmc@metro.cx (Koen Martens) http://www.metro.cx/
!!DE AARDE IS GEEN WEGWERPPRODUCT!!

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: spfd FreeBSD rc.d script [ In reply to ]
On Thu, 27 May 2004 spf@metro.cx wrote:

> Hi,
>
> Maybe this is a stupid suggestion, but as long is there is no pid-file how about ps+grep?

I believe that this (or killall, since it's Linux) is what the gentoo
version does. Might be worth reading start-stop-daemon.

S.

> On Wed, May 26, 2004 at 07:31:38PM +0100, Matt Sealey wrote:
> >
> > Hello all,
> >
> > I checked the archives and there was a rumbling not long
> > back about an rc.d script - did anyone get any further
> > with this?
> >
> > I hacked up a VERY basic one using rc_subr but of course
> > it's hindered by the simple fact that spfd doesn't record
> > it's PID anywhere.
> >
> > It basically means you can't tell if the daemon is already
> > running, which is fairly bad with the Exim ACL since it
> > defers all mail when it can't connect to the spfd socket.
> >
> > The solution I expect would be the same as with Clamd or
> > something similar - run a cron job every now and again
> > to check if spfd is still running under the pid it last
> > recorded, and restart it if necessary.
> >
> > So two questions, then! Anyone up for adding pidfile
> > support for spfd, and when someone does that, does anyone
> > want to write a script to check if it's still running
> > so we can run that cron job? (rc_subr has this built-in
> > as long as there is a pidfile). I must admit I'm not
> > talented enough to do either, Perl is something I
> > gave up on a long time ago ;)
> >
> > Thanks,
> >
> > --
> > Matt Sealey <matt@genesi.co.uk>
> > Genesi, Manager, Developer Relations
> >
> > -------
> > To unsubscribe, change your address, or temporarily deactivate your subscription,
> > please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
>
>

--
Shevek http://www.anarres.org/
I am the Borg. http://www.gothnicity.org/

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com