]> git.pld-linux.org Git - packages/vsftpd.git/blame - vsftpd.init
- up to 2.0.4 (file locking support, fix timezone issues)
[packages/vsftpd.git] / vsftpd.init
CommitLineData
c5b58c01
AG
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.
16if 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
21else
22 exit 0
23fi
24
25RETVAL=0
26# See how we were called.
27case "$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=([Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1)' /etc/vsftpd.conf; then
33 echo "error: Missing 'listen=yes' directive in /etc/vsftpd.conf!"
34 exit 1
35 fi;
36 msg_starting vsftpd
37 daemon --fork /usr/sbin/vsftpd
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vsftpd
40 else
41 msg_already_running vsftpd
42 fi
43 ;;
44 stop)
45 # Stop daemons.
46 if [ -f /var/lock/subsys/vsftpd ]; then
47 msg_stopping vsftpd
48 killproc vsftpd
49 rm -f /var/lock/subsys/vsftpd > /dev/null 2>&1
50 else
51 msg_not_running vsftpd
52 fi
53 ;;
54 restart|force-reload)
55 $0 stop
56 $0 start
57 exit $?
58 ;;
59 *)
60 msg_usage "$0 {start|stop|restart|force-reload}"
61 exit 3
62 ;;
63esac
64
65exit $RETVAL
This page took 0.034675 seconds and 4 git commands to generate.