source: branches/fc17-dev/server/fedora/specs/zhm.init @ 2207

Last change on this file since 2207 was 1693, checked in by ezyang, 14 years ago
Merge Fedora 13 development back to trunk.
File size: 2.0 KB
Line 
1#!/bin/sh
2#
3# zhm          Startup script for Zephyr Host Manager
4#
5# chkconfig:   - 20 80
6# description: The Zephyr Host Manager coordinates all incoming
7#              and outgoing messages for a given host.  If it
8#              is not running, you will not be able to send or
9#              receive Zephyr messages.
10
11# XXX needs configuration file support
12
13# XXX this needs to be audited
14### BEGIN INIT INFO
15# Provides: zhm
16# Required-Start: $local_fs $remote_fs $network $named
17# Required-Stop: $local_fs $remote_fs $network
18# Default-Start: 2 3 4 5
19# Default-Stop: 0 1 6
20# Short-Description: start and stop Zephyr Host Manager
21# Description: The Zephyr Host Manager coordinates all incoming
22#              and outgoing messages for a given host.
23### END INIT INFO
24
25# Source function library.
26. /etc/rc.d/init.d/functions
27
28exec="/usr/sbin/zhm"
29prog="zhm"
30
31[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
32
33lockfile=/var/lock/subsys/$prog
34
35start() {
36    [ -x $exec ] || exit 5
37    echo -n $"Starting $prog: "
38    daemon $exec
39    retval=$?
40    echo
41    [ $retval -eq 0 ] && touch $lockfile
42    return $retval
43}
44
45stop() {
46    echo -n $"Stopping $prog: "
47    killproc $prog
48    retval=$?
49    echo
50    [ $retval -eq 0 ] && rm -f $lockfile
51    return $retval
52}
53
54restart() {
55    stop
56    start
57}
58
59reload() {
60    restart
61}
62
63force_reload() {
64    restart
65}
66
67rh_status() {
68    # run checks to determine if the service is running or use generic status
69    status $prog
70}
71
72rh_status_q() {
73    rh_status >/dev/null 2>&1
74}
75
76
77case "$1" in
78    start)
79        rh_status_q && exit 0
80        $1
81        ;;
82    stop)
83        rh_status_q || exit 0
84        $1
85        ;;
86    restart)
87        $1
88        ;;
89    reload)
90        rh_status_q || exit 7
91        $1
92        ;;
93    force-reload)
94        force_reload
95        ;;
96    status)
97        rh_status
98        ;;
99    condrestart|try-restart)
100        rh_status_q || exit 0
101        restart
102        ;;
103    *)
104        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
105        exit 2
106esac
107exit $?
Note: See TracBrowser for help on using the repository browser.