View | Details | Raw Unified | Return to bug 103626 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-26 / +25 lines)
Lines 1-29 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# PROVIDE: smokeping
3
# REQUIRE: DAEMON
4
# BEFORE: LOGIN
5
# KEYWORD: shutdown
2
6
3
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
7
. /etc/rc.subr
4
    echo "$0: Cannot determine the PREFIX" >&2
5
    exit 1
6
fi
7
8
case "$1" in
9
start)
10
        [ -r ${PREFIX}/etc/smokeping/config ] && \
11
           su -f -m smokeping -c ${PREFIX}/bin/smokeping > /dev/null && \
12
           echo -n ' smokeping'
13
        ;;
14
restart)
15
        [ -r ${PREFIX}/etc/smokeping/config ] && \
16
           su -f -m smokeping -c "${PREFIX}/bin/smokeping --restart" > /dev/null && \
17
           echo -n ' smokeping'
18
        ;;
19
stop)
20
        [ -r ${PREFIX}/var/smokeping/smokeping.pid ] && \
21
           su -f -m smokeping -c "kill `cat ${PREFIX}/var/smokeping/smokeping.pid`" > /dev/null && \
22
           echo -n ' smokeping'
23
        ;;
24
*)
25
        echo "Usage: `basename $0` {start|restart|stop}" >&2
26
        ;;
27
esac
28
8
29
exit 0
9
name=smokeping
10
rcvar=`set_rcvar`
11
smokeping_user=${smokeping_user-"smokeping"}
12
13
command=/usr/local/bin/smokeping
14
_pidprefix=/var/run/smokeping
15
pidfile=${_pidprefix}/smokeping.pid
16
17
extra_commands="reload"
18
reload_cmd=${name}_reloadcmd
19
20
smokeping_reloadcmd()
21
(
22
       $command --reload
23
24
)
25
26
27
load_rc_config $name
28
run_rc_command "$1"

Return to bug 103626