/etc/init.d/pure-ftpd-postgresql is in pure-ftpd-postgresql 1.0.46-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | #! /bin/sh
### BEGIN INIT INFO
# Provides: pure-ftpd-postgresql
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: slapd mysql postgresql-8.3 postgresql-8.4
# Should-Stop: slapd mysql postgresql-8.3 postgresql-8.4
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
#
# pure-ftpd starts and stops the pure-ftpd ftp daemon
#
# Copyright 2002-2011 by Stefan Hornburg (Racke) <racke@linuxia.de>
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=pure-ftpd
DESC="ftp server"
: ${SSDAEMONLOGOPTS:="--quiet"}
UPLOADDAEMON=/usr/sbin/pure-uploadscript
UDNAME=pure-uploadscript
UDDESC="ftp upload handler"
WRAPPER=/usr/sbin/pure-ftpd-wrapper
# load LSB init-functions to get status_of_proc helper
. /lib/lsb/init-functions
PIDFILE=/var/run/pure-ftpd/pure-ftpd.pid
# try to figure with suffix this script is called,
# $0 might be a symlink pointing to this script
if [ -h $0 ]; then
ME=`/bin/readlink $0`
else
ME=$0
fi
SUFFIX=`basename $ME | sed -ne 's/^pure-ftpd-\(.*\)/\1/p'`
if [ "$SUFFIX" ] ; then
DAEMON=/usr/sbin/pure-ftpd-$SUFFIX
else
DAEMON=/usr/sbin/pure-ftpd
fi
export STANDALONE_OR_INETD=inetd
export VIRTUALCHROOT=
test -r /etc/default/pure-ftpd-common && . /etc/default/pure-ftpd-common
if [ "$VIRTUALCHROOT" = "true" ]; then
if [ "$SUFFIX" ]; then
SUFFIX="$SUFFIX-virtualchroot"
else
SUFFIX="virtualchroot"
fi
fi
test -x $DAEMON || exit 0
test -x $WRAPPER || exit 0
set -e
if [ ! -e `dirname $PIDFILE` ];then
mkdir `dirname $PIDFILE`
fi
start_uploadscript() {
if [ "$UPLOADSCRIPT" -a "$STANDALONE_OR_INETD" != inetd ] && \
egrep -i '^[ ]*(yes|1|on)[ ]*' /etc/pure-ftpd/conf/CallUploadScript > /dev/null 2>&1
then
UOPTS=""
test "$UPLOADUID" && UOPTS="$UOPTS -u $UPLOADUID"
test "$UPLOADGID" && UOPTS="$UOPTS -g $UPLOADGID"
echo -n "$1 $UDDESC: "
start-stop-daemon --start $SSDAEMONLOGOPTS --oknodo \
--exec $UPLOADDAEMON -- -r "$UPLOADSCRIPT" -B $UOPTS
echo "$UDNAME."
fi
}
case "$1" in
start)
test "$STANDALONE_OR_INETD" = standalone || exit 0
echo -n "Starting $DESC: "
start-stop-daemon --start $SSDAEMONLOGOPTS --pidfile "$PIDFILE" \
--exec $WRAPPER -- $SUFFIX
start_uploadscript Starting
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo \
--pidfile "$PIDFILE"
start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo --exec $UPLOADDAEMON
echo "$NAME."
;;
restart|force-reload)
test "$STANDALONE_OR_INETD" = standalone || exit 0
echo -n "Restarting $DESC: "
start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo \
--pidfile "$PIDFILE"
start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo --exec $UPLOADDAEMON
sleep 1
start-stop-daemon --start $SSDAEMONLOGOPTS --pidfile "$PIDFILE" \
--exec $WRAPPER -- $SUFFIX
start_uploadscript Restarting
;;
status)
status_of_proc -p /var/run/pure-ftpd/pure-ftpd.pid $DAEMON $NAME && exit 0 || exit $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|