Subversion Repositories configs

Rev

Rev 4 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
# chkconfig: 235 99 10
154 - 3
# description: web-based administration interface for Unix systems
4 - 4
#
5
### BEGIN INIT INFO
154 - 6
# Provides:          webmin
7
# Required-Start:    $local_fs $network $syslog
8
# Required-Stop:     $local_fs $network
9
# Default-Start:     2 3 4 5
10
# Default-Stop:      0 1 6
11
# Short-Description: web-based administration interface for Unix systems
12
# Description:       Webmin is a web-based interface for system administration
13
#                    for Unix. Using Webmin you can configure DNS, Samba, NFS,
14
#                    local/remote filesystems and more using your web browser.
4 - 15
### END INIT INFO
16
 
154 - 17
PATH=/sbin:/usr/sbin:/bin:/usr/bin
18
DESC="web-based administration interface for Unix systems"
19
NAME=Webmin
20
PIDFILE=/var/webmin/miniserv.pid
21
SCRIPTNAME=/etc/init.d/$NAME
22
START=/etc/webmin/start
23
STOP=/etc/webmin/stop
24
RELOAD=/etc/webmin/reload
25
LOCKFILE=/var/lock/subsys/webmin
26
CONFFILE=/etc/webmin/miniserv.conf
4 - 27
 
28
case "$1" in
154 - 29
start)
30
	$START >/dev/null 2>&1 </dev/null
4 - 31
	RETVAL=$?
32
	if [ "$RETVAL" = "0" ]; then
154 - 33
		touch $LOCKFILE >/dev/null 2>&1
4 - 34
	fi
35
	;;
154 - 36
stop)
37
	$STOP
4 - 38
	RETVAL=$?
39
	if [ "$RETVAL" = "0" ]; then
154 - 40
		rm -f $LOCKFILE
4 - 41
	fi
154 - 42
	pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
4 - 43
	if [ "$pidfile" = "" ]; then
154 - 44
		pidfile=$PIDFILE
4 - 45
	fi
46
	rm -f $pidfile
47
	;;
154 - 48
status)
49
	pidfile=`grep "^pidfile=" $CONFFILE | sed -e 's/pidfile=//g'`
4 - 50
	if [ "$pidfile" = "" ]; then
154 - 51
		pidfile=$PIDFILE
4 - 52
	fi
53
	if [ -s $pidfile ]; then
54
		pid=`cat $pidfile`
55
		kill -0 $pid >/dev/null 2>&1
56
		if [ "$?" = "0" ]; then
154 - 57
			echo "$NAME (pid $pid) is running"
4 - 58
			RETVAL=0
59
		else
154 - 60
			echo "$NAME is stopped"
4 - 61
			RETVAL=1
62
		fi
63
	else
154 - 64
		echo "$NAME is stopped"
4 - 65
		RETVAL=1
66
	fi
67
	;;
154 - 68
restart)
69
	$STOP ; $START
4 - 70
	RETVAL=$?
71
	;;
154 - 72
reload|force-reload)
73
	$RELOAD
74
	RETVAL=$?
75
	;;
4 - 76
*)
154 - 77
	echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2
4 - 78
	RETVAL=1
79
	;;
80
esac
81
exit $RETVAL
82