Oops, that doesn't work.

    ps -opid= -C vsftpd h | sed 's/ //g' | tail -n 1 >  
/var/run/vsftpd/vsftpd.pid

Actually works.

I changed my /etc/init.d/vsftpd to:

<start>

#!/bin/sh
# /etc/init.d/vsftpd
#
# Written by Sander Smeenk <[EMAIL PROTECTED]>

set -e

# Exit if vsftpd.conf doesn't have listen=yes or listen_ipv6=yes
# (mandatory for standalone operation)
if [ -f /etc/vsftpd.conf ] && ! egrep -iq "^ *listen(_ipv6)? *= *yes" 
/etc/vsftpd.conf; then
    exit 0
fi

DAEMON=/usr/sbin/vsftpd
NAME=vsftpd


test -x $DAEMON || exit 0

fixpid()
{
    ps -opid= -C vsftpd h | sed 's/ //g' | tail -n 1 >  
/var/run/vsftpd/vsftpd.pid
}

case "$1" in
  start)
    echo -n "Starting FTP server: $NAME"
    start-stop-daemon --start --background -m --pidfile 
/var/run/vsftpd/vsftpd.pid --exec $DAEMON
    fixpid
    echo "."
    ;;
  stop)
    echo -n "Stopping FTP server: $NAME"
    start-stop-daemon --stop --pidfile /var/run/vsftpd/vsftpd.pid --oknodo 
--exec $DAEMON
    echo "."
      ;;
  restart)
    echo -n "Restarting FTP server: $NAME"
    start-stop-daemon --stop --pidfile /var/run/vsftpd/vsftpd.pid --oknodo 
--exec $DAEMON
    start-stop-daemon --start --background -m --pidfile 
/var/run/vsftpd/vsftpd.pid --exec $DAEMON
    fixpid
    echo "."
    ;;
  reload|force-reload)
    echo "Reloading $NAME configuration files"
    start-stop-daemon --stop --pidfile /var/run/vsftpd/vsftpd.pid --signal 1 
--exec $DAEMON
    fixpid
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
    exit 1
    ;;
esac

exit 0

<end>

And that seems to be working fine for me. (I made fixpid a function in case I 
find a better command later).



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to