supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Daemontools run script
@ 2006-08-01  9:15 ed neville
  0 siblings, 0 replies; 5+ messages in thread
From: ed neville @ 2006-08-01  9:15 UTC (permalink / raw)




Hello,

Here's a subversion scripty from my Debian system YMMV...

#!/bin/sh

exec 2>&1
exec /usr/bin/svnserve -d --foreground

--
"Unix gives us the power we need to crush those who oppose us"  
Regards,
Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Daemontools run script
  2006-08-02  9:07 ed neville
  2006-08-02 16:59 ` Wayne Marshall
  2006-08-02 20:09 ` Laurent Bercot
@ 2006-08-03 18:35 ` George Georgalis
  2 siblings, 0 replies; 5+ messages in thread
From: George Georgalis @ 2006-08-03 18:35 UTC (permalink / raw)


On Wed, Aug 02, 2006 at 10:07:28AM +0100, ed neville wrote:
>
>Here is an alternative vsftpd script without using tcpserver, in theory
>a little more efficient as a new cop of vsftpd is not forked on all
>connections
>

thanks for posting, so we all get a chance to learn now and then. :)

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Daemontools run script
  2006-08-02  9:07 ed neville
  2006-08-02 16:59 ` Wayne Marshall
@ 2006-08-02 20:09 ` Laurent Bercot
  2006-08-03 18:35 ` George Georgalis
  2 siblings, 0 replies; 5+ messages in thread
From: Laurent Bercot @ 2006-08-02 20:09 UTC (permalink / raw)


> Here is an alternative vsftpd script without using tcpserver, in theory
> a little more efficient as a new cop of vsftpd is not forked on all
> connections

 In addition to what Wayne just said, I believe you need to read the
archives for this mailing-list, as well as the archives for the
log@list.cr.yp.to list, to fully understand what supervision is about.
 Your signature talks about the power of Unix, but the sentence above
shows that you're misunderstanding this power. ;)

-- 
 Laurent


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Daemontools run script
  2006-08-02  9:07 ed neville
@ 2006-08-02 16:59 ` Wayne Marshall
  2006-08-02 20:09 ` Laurent Bercot
  2006-08-03 18:35 ` George Georgalis
  2 siblings, 0 replies; 5+ messages in thread
From: Wayne Marshall @ 2006-08-02 16:59 UTC (permalink / raw)


On Wed, 2 Aug 2006 10:07:28 +0100
"ed neville" <ed.neville@ukplc.net> wrote:

> 
> Here is an alternative vsftpd script without using tcpserver, in
> theory a little more efficient as a new cop of vsftpd is not forked
> on all connections
> 
> #!/bin/sh
> 
> exec 2>&1
> 
> PF="/var/run/vsftpd/vsftpd.pid";
> VSB="/usr/sbin/vsftpd";
> 
> while [ true ] ;
> do
>         PID=$( cat $PF );
>         CMD=$( cat /proc/$PID/cmdline 2>&1 );
>         if [ "$CMD" != "$VSB" ] ;
>         then
>                 echo "$VSB not running" ;
>                 /etc/init.d/vsftpd stop
>                 /etc/init.d/vsftpd start
>         fi ;
>         sleep 5;
> done ;
> 
> 

This script indicates some (rather massive) confusion about what it
means to run a service under supervision.  All you really want here is
this:

#!/bin/sh
exec 2>&1
exec /usr/sbin/vsftpd
#EOF

Set up your vstpd.conf file with 'background=NO' and 'listen=YES' and
no other run script gymnastics.  The service supervisor will keep track
of the PID for you, and will automatically notice if the service dies,
in which case it will try to restart it.  You will manage the service
directly with svc/sv to start/stop/restart/etc, and none of the slag
from /etc/init.d.

As for not using tcpserver/tcpsvd, that's up to you, but for an ftp
service it is probably not worth the loss of the concurrency limits
and fine-grained connection control possible with
tcprules/ipsvd-instruct (with the -x option).

A few other examples of services may be found here:

  http://thedjbway.org/services.html

Wayne





^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Daemontools run script
@ 2006-08-02  9:07 ed neville
  2006-08-02 16:59 ` Wayne Marshall
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: ed neville @ 2006-08-02  9:07 UTC (permalink / raw)


ed neville wrote:
> Hello,
> 
> Here's a subversion scripty from my Debian system YMMV...
> 
> #!/bin/sh
> 
> exec 2>&1
> exec /usr/bin/svnserve -d --foreground

Hello,

Here is an alternative vsftpd script without using tcpserver, in theory
a little more efficient as a new cop of vsftpd is not forked on all
connections

#!/bin/sh

exec 2>&1

PF="/var/run/vsftpd/vsftpd.pid";
VSB="/usr/sbin/vsftpd";

while [ true ] ;
do
        PID=$( cat $PF );
        CMD=$( cat /proc/$PID/cmdline 2>&1 );
        if [ "$CMD" != "$VSB" ] ;
        then
                echo "$VSB not running" ;
                /etc/init.d/vsftpd stop
                /etc/init.d/vsftpd start
        fi ;
        sleep 5;
done ;


-- 
"Unix gives us the power we need to crush those who oppose us"
Regards,
Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-03 18:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01  9:15 Daemontools run script ed neville
2006-08-02  9:07 ed neville
2006-08-02 16:59 ` Wayne Marshall
2006-08-02 20:09 ` Laurent Bercot
2006-08-03 18:35 ` George Georgalis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).