Also Zusammenfassung:
1. Das Script läuft unter SuSE 8.2
2. Das Problem waren Steuerzeichen durch Copy&Paste
Wörsty
#!/bin/sh
#
# /etc/init.d/proftpd
# Startscript for SuSE 8.2
# mailto:
proftpd_init.d@woerstenfeld.de#
### BEGIN INIT INFO
# Provides: proftpd
# Required-Start: $local_fs $remote_fs $network
# X-UnitedLinux-Should-Start: $named $time postgresql sendmail mysql ypclient dhcp radiusd
# Required-Stop: $local_fs $remote_fs $network
# X-UnitedLinux-Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Proftpd FTP-Server
# Description: Start the proftpd daemon
### END INIT INFO
#
# load the configuration
#
USER_TO_RUN="ftpserver"
LOGFILEPATH="/var/log/proftpd"
CONFFILEPATH="/etc/proftpd.conf"
PROFTPD_BIN="/usr/sbin/proftpd"
PIDFILE="/var/run/proftpd.pid"
test -s /etc/rc.status && \
. /etc/rc.status
test -x $PROFTPD_BIN || exit 5
rc_reset
#
# The echo return value for success (defined in /etc/rc.status).
#
return=$rc_done
#
# main part
#
case "$1" in
start)
echo -n "Starting proftpd "
if test -f $PIDFILE; then
echo "Error: PID-File found!"
rc_failed 1
rc_status -v
else
if $PROFTPD_BIN; then
startproc -t 10 $PROFTPD_BIN
ret=$?
rc_failed $ret
rc_status -v
else
rc_failed 1
rc_status -v
fi
if test -e $LOGFILEPATH ; then
chown $USER_TO_RUN $LOGFILEPATH ;
else
mkdir $LOGFILEPATH
chown $USER_TO_RUN $LOGFILEPATH ;
fi
fi
;;
stop)
echo -n "Shutting down profpd"
#killproc -G -TERM $PROFTPD_BIN
/bin/kill `cat $PIDFILE 2> /dev/null ` > /dev/null 2>&1
ret=$?
rc_failed $ret
rm -f $PIDFILE > /dev/null 2>&1
rc_status -v
;;
restart)
$0 stop && sleep 3
$0 start
# Remember status and be quiet
rc_status
;;
reload)
echo -n "Reload proftpd"
if $PROFTPD_BIN ; then
killproc -USR1 $PROFTPD_BIN || return=$rc_failed
rc_status -v
else
rc_failed 6
rc_status -v1
fi
;;
status)
echo -n "Checking for proftpd: "
checkproc $PROFTPD_BIN
ftpwho -v
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
esac
# Inform the caller not only verbosely and set an exit status.
rc_exit