[go: up one dir, main page]

File: mon_fsstatd

package info (click to toggle)
s390-tools 1.6.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,160 kB
  • ctags: 3,968
  • sloc: ansic: 26,413; asm: 5,072; sh: 4,042; cpp: 1,518; perl: 1,299; makefile: 587
file content (89 lines) | stat: -rw-r--r-- 1,472 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/bash
### BEGIN INIT INFO
# Provides: mon_fsstatd
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start:  1 2 3 4 5
# Default-Stop: 0 6
# Short-Description: Configure the mon_fsstatd daemon.
# Description: Configures the mon_fsstatd daemon. It uses the configuration
#              file /etc/sysconfig/mon_fsstatd
### END INIT INFO

# chkconfig: 12345 01 99

DAEMON=mon_fsstatd
DAEMON_PATH=/usr/sbin/mon_fsstatd
CONFIG_FILE=/etc/sysconfig/$DAEMON
RUN_PID_FILE=/var/run/$DAEMON.pid
RETVAL=0

# source function library
. /lib/lsb/init-functions

# Source config file
if [ -f $CONFIG_FILE ]; then
	. $CONFIG_FILE
fi

start()
{
	if [ ! -f $RUN_PID_FILE ]; then
		echo -n $"Starting $DAEMON:"
		$DAEMON_PATH $OPTIONS && log_success_msg || log_failure_msg
		echo
	else
		echo "$DAEMON (pid $(cat $RUN_PID_FILE)) is already running..."
		echo
	fi
}

stop()
{
	echo -n $"Stopping $DAEMON:"
	if [ -f $RUN_PID_FILE ]; then
		killproc $DAEMON_PATH -TERM
		log_success_msg
		rm -f $RUN_PID_FILE
	else
		log_failure_msg
	fi
	echo
}

restart() {
	stop
	start
}

status()
{
	if [ ! -f $RUN_PID_FILE ]; then
		echo "$DAEMON is not running."
		echo
	else
		echo "$DAEMON (pid $(cat $RUN_PID_FILE), options: $OPTIONS) is running."
		echo
	fi
}

# How are we called?
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	status)
		status
		;;
	restart|reload)
		restart
		;;
	*)
		echo "Usage: $DAEMON {start|stop|status|restart|reload}"
		RETVAL=1
esac

exit $RETVAL