creating a sysv script

Paul Howarth paul at city-fan.org
Fri Jan 28 07:51:44 UTC 2005


On Thu, 2005-01-27 at 16:09 -0500, Scot L. Harris wrote:
> On Thu, 2005-01-27 at 12:13, Craig White wrote:
> > ----
> > that's exactly what I'm trying to do - when I launch it as it is now
> > (from within /etc/rc.d/init.d/relay) and I chkconfig and service start
> > stuff...it still is controlled by a terminal
> > 
> > #ps aux|grep relaydelay
> > root     28682  0.0  1.2 38960 6404 pts/3    S    07:50
> > 0:00 /usr/bin/perl -w /root/relaydelay-0.04/relaydelay.pl
> > 
> > note -> pts/3 
> > 
> > If I close that terminal, program stops.
> > 
> > I would love to see what you get from ps aux command...
> > 
> > If your launch is detached from a terminal (i.e. a ? instead of pts/3 or
> > some other) then I would love to see your sysV script. I know that at
> > the beginning of the thread, I included mine.
> > 
> > Craig
> 
> 
> Try this.
> 
> 
> $ ps -eaf |grep grey 
> smmsp    27841     1  0 Jan19 ?        00:00:00
> /usr/local/bin/milter-greylist -
> 
> 
> 
> 
> 
> -- 
> Scot L. Harris
> webid at cfl.rr.com
> 
> The grass is always greener on the other side of your sunglasses. 
> #!/bin/sh
> # $Id: rc-linux.sh.in,v 1.1 2004/04/03 09:26:11 manu Exp $
> #  init file for milter-greylist
> #
> # chkconfig: - 50 50
> # description: Milter Greylist Daemon
> #
> # processname: /usr/local/bin/milter-greylist
> # config: /etc/mail/greylist.conf
> # pidfile: /var/run/milter-greylist.pid
> 
> # source function library
> . /etc/init.d/functions
> 
> pidfile="/var/run/milter-greylist.pid"
> socket="/var/milter-greylist/milter-greylist.sock"
> user="smmsp"
> OPTIONS="-P $pidfile -u $user -p $socket"
> RETVAL=0
> prog="Milter-Greylist"
> 
> start() {
>         echo -n $"Starting $prog: "
>         if [ $UID -ne 0 ]; then
>                 RETVAL=1
>                 failure
>         else
>                 daemon /usr/local/bin/milter-greylist $OPTIONS

It appears from this that your milter-greylist properly daemonizes
itself (i.e. it detaches itself from the terminal), unlike the milter
Craig is trying to use. So I expect this script won't work for him.

It might actually be easier to patch the (perl) milter to do this, in
much the same way as the SPF milter does at
http://spf.pobox.com/sendmail-milter-spf-1.41.pl

(the relevant code is near the bottom of the file)

Paul.
-- 
Paul Howarth <paul at city-fan.org>




More information about the fedora-list mailing list