File: init

package info (click to toggle)
proftpd 1.2.0pre9-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,392 kB
  • ctags: 2,648
  • sloc: ansic: 24,012; sh: 1,754; makefile: 536; perl: 281
file content (89 lines) | stat: -rw-r--r-- 1,475 bytes parent folder | download
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
#!/bin/sh
#
# Start the proftpd FTP daemon.

# For more exhaustive logging, try "-d 3" as proftpd_options.

run_proftpd=1
proftpd_options=""

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/proftpd
NAME=proftpd
FLAGS="defaults 50"

trap "" 1
trap "" 15

test -f $DAEMON || exit 0

if ! egrep -q "^[:space:]*ServerType.*standalone" /etc/proftpd.conf
then
    run_proftpd=0
fi

case "$1" in

  start)
    if [ $run_proftpd = 1 ]
    then
        update-inetd --disable ftp
	echo -n "Starting professional ftp daemon: "
	if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
	    --exec $DAEMON -- $proftpd_options
	then
	    echo "$NAME."
	else
	    echo
	fi
    fi
    ;;

  stop)
    if [ $run_proftpd = 1 ]
    then
	echo -n "Stopping professional ftp daemon: "
	if killall $NAME > /dev/null 2>&1
	then
	    echo "$NAME."
	else
	    echo
	fi
    fi
    ;;

  reload)
    echo -n "Reloading $NAME configuration..."
    if killall -1 $NAME > /dev/null 2>&1
    then
	echo done.
    else
	echo failed.
    fi
    ;;

  restart)
    $0 force-reload
    ;;

  force-reload)
    echo -n "Restarting $NAME daemon."
    /etc/init.d/$NAME stop > /dev/null 2>&1
    echo -n "."
    sleep 2
    echo -n "."
    if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
	--exec $DAEMON -- $proftpd_options
    then
	echo "done."
    fi
    ;;

  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}"
    exit 1
    ;;

esac

exit 0