]> git.pld-linux.org Git - packages/vsftpd.git/blob - vsftpd.init
- try to load capability module
[packages/vsftpd.git] / vsftpd.init
1 #!/bin/sh
2 #
3 # vsftpd        vsftp server
4 #
5 # chkconfig:    345 85 15
6 # description:  VSFTPD is a Very Secure FTP Daemon
7 #
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Check that networking is up.
16 if is_yes "${NETWORKING}"; then
17         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
18                 msg_network_down vsftpd
19                 exit 1
20         fi
21 else
22         exit 0
23 fi
24
25 RETVAL=0
26 # See how we were called.
27 case "$1" in
28   start)
29         # Check if the service is already running?
30         if [ ! -f /var/lock/subsys/vsftpd ]; then
31                 # Check if we have 'Listen=yes' in config
32                 if ! egrep -q '^(listen|listen_ipv6)=([Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1)' /etc/vsftpd.conf; then
33                         echo "error: Missing 'listen=yes' or 'listen_ipv6=yes' directive in /etc/vsftpd.conf!"
34                         exit 1
35                 fi;
36                 # try to load capability module
37                 _modprobe capability
38                 msg_starting vsftpd
39                 daemon --fork /usr/sbin/vsftpd 
40                 RETVAL=$?
41                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vsftpd
42         else
43                 msg_already_running vsftpd
44         fi
45         ;;
46   stop)
47         # Stop daemons.
48         if [ -f /var/lock/subsys/vsftpd ]; then
49                 msg_stopping vsftpd
50                 killproc vsftpd
51                 rm -f /var/lock/subsys/vsftpd > /dev/null 2>&1
52         else
53                 msg_not_running vsftpd
54         fi
55         ;;
56   restart|force-reload)
57         $0 stop
58         $0 start
59         exit $?
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|force-reload}"
63         exit 3
64         ;;
65 esac
66
67 exit $RETVAL
This page took 0.037796 seconds and 4 git commands to generate.