summaryrefslogtreecommitdiffstats
path: root/opensuse/tdebase/ksysguardd.init
blob: 3be2cba3bd7e704b247ef0b669659af4a634cf6a (plain)
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
#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
#
# Author: adrian@suse.de
#
# /etc/init.d/ksysguardd
#   and its symbolic  link
# /usr/sbin/rcksysguardd
#
### BEGIN INIT INFO
# Provides:          ksysguardd
# Required-Start:    $time $named
# Should-Start:      $syslog slpd
# Required-Stop:     $null
# Default-Start:     3 5
# Default-Stop:      0 1 2 4 6
# Description:       remote monitor daemon for ksysguard
# Short-Description: remote monitor daemon for ksysguard
### END INIT INFO

. /etc/rc.status
test -e /etc/rc.config && source /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test -x /usr/bin/ksysguardd    || exit 0

rc_reset
case "$1" in
    start)
	echo -n "Starting remote monitor daemon for ksysguard "

	/usr/bin/ksysguardd -d -i >/dev/null
	rc_status -v
	;;
    stop)
        if [ -e /var/run/ksysguardd.pid ]; then
	   echo -n "Shutting down remote monitor daemon for ksysguard "
	   killproc -p /var/run/ksysguardd.pid -TERM /usr/bin/ksysguardd
	   rc_status -v
        fi
	;;
    try-restart|condrestart)
        if test "$1" = "condrestart"; then
                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
        fi
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    restart|force-reload)
	## If first returns OK call the second, if first or
	## second command fails, set echo return value.
	$0 stop; sleep 1  &&  $0 start
	rc_status
	;;
    reload)
	$0 stop  &&  $0 start
	rc_status
	;;
    status)
	echo -n "Checking for remote monitor daemon for ksysguard "

        checkproc -p /var/run/ksysguardd.pid /usr/bin/ksysguardd
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|reload|try-restart|force-reload}"
	exit 1
	;;
esac
rc_exit