-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.d.proftpd
71 lines (62 loc) · 1.42 KB
/
init.d.proftpd
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
#! /bin/sh
# chkconfig: 2345 55 25
# Description: Startup script for proftpd on Debian. Place in /etc/init.d and
# run 'update-rc.d -f proftpd defaults', or use the appropriate command on your
# distro. For CentOS/Redhat run: 'chkconfig --add proftpd'
### BEGIN INIT INFO
# Provides: proftpd
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the proftpd server
# Description: starts proftpd using start-stop-daemon
### END INIT INFO
# Author: licess
# website: http://lnmp.org
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="proftpd daemon"
NAME=proftpd
DAEMON=/usr/local/proftpd/sbin/$NAME
CONFIGFILE=/usr/local/proftpd/etc/$NAME.conf
PIDFILE=/usr/local/proftpd/var/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
set -e
[ -x "$DAEMON" ] || exit 0
do_start() {
$DAEMON || echo -n "$NAME already running"
}
do_stop() {
kill -INT `cat $PIDFILE` || echo -n "$NAME not running"
}
do_reload() {
kill -HUP `cat $PIDFILE` || echo -n "$NAME can't reload"
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
do_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
do_stop
echo "."
;;
restart)
echo -n "Restarting $DESC: $NAME"
do_stop
do_start
echo "."
;;
reload)
echo -n "Stopping $DESC: $NAME"
do_reload
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2
exit 3
;;
esac
exit 0