Created
May 6, 2011 09:21
-
-
Save srounet/958680 to your computer and use it in GitHub Desktop.
init.d script for pure-ftpd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: pure-ftpd | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts pure-ftpd server | |
# Description: starts pure-ftpd server | |
### END INIT INFO | |
DAEMON=/usr/local/sbin/pure-ftpd | |
LOGFILE=/var/log/pureftpd.log | |
NAME=pure-ftpd | |
PATH=/usr/local/sbin:$PATH | |
PGSQLCONFIG=/etc/pureftpd-pgsql.conf | |
PIDFILE=/var/run/pure-ftpd.pid | |
test -x $DAEMON || exit 0 | |
case "$1" in | |
start) | |
echo -n "Starting $DESC: " | |
exec start-stop-daemon --start --pidfile "$PIDFILE" --exec $DAEMON -- -l pgsql:$PGSQLCONFIG -A -B | |
echo "$NAME." | |
;; | |
stop) | |
echo -n "Stopping $DESC: " | |
exec start-stop-daemon --stop --oknodo --pidfile "$PIDFILE" | |
echo "$NAME." | |
;; | |
restart|force-reload) | |
echo -n "Restarting $DESC: " | |
exec start-stop-daemon --stop --oknodo --pidfile "$PIDFILE" | |
sleep 1 | |
exec start-stop-daemon --start --pidfile "$PIDFILE" --exec $DAEMON -- -l pgsql:$PGSQLCONFIG -A -B | |
echo "$NAME." | |
;; | |
reload) | |
echo -n "Reloading $DESC configuration: " | |
exec start-stop-daemon --stop --signal HUP --quiet --pidfile "$PIDFILE" --exec $DAEMON -- -l pgsql:$PGSQLCONFIG -A -B | |
echo "$NAME." | |
;; | |
*) | |
N=/etc/init.d/$NAME | |
echo "Usage: $N {start|stop|restart|force-reload}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment