Line | |
---|
1 | #! /bin/sh
|
---|
2 |
|
---|
3 |
|
---|
4 | PATH=/usr/sbin:/usr/bin:/sbin
|
---|
5 | export PATH
|
---|
6 |
|
---|
7 | rval=0
|
---|
8 |
|
---|
9 | DAEMON=@sbindir@/@install_name@
|
---|
10 | NAME=@install_name@
|
---|
11 |
|
---|
12 | if /sbin/chkconfig verbose; then
|
---|
13 | verbose=1
|
---|
14 | else
|
---|
15 | verbose=0
|
---|
16 | fi
|
---|
17 |
|
---|
18 | log_stat_msg () {
|
---|
19 | case "$1" in
|
---|
20 | 0)
|
---|
21 | echo "Service $NAME: Running";
|
---|
22 | break;
|
---|
23 | ;;
|
---|
24 | 1)
|
---|
25 | echo "Service $NAME: Stopped and /var/run pid file exists";
|
---|
26 | break;
|
---|
27 | ;;
|
---|
28 | 3)
|
---|
29 | echo "Service $NAME: Stopped";
|
---|
30 | break;
|
---|
31 | ;;
|
---|
32 | *)
|
---|
33 | echo "Service $NAME: Status unknown";
|
---|
34 | break;
|
---|
35 | ;;
|
---|
36 | esac
|
---|
37 | }
|
---|
38 |
|
---|
39 | case "$1" in
|
---|
40 |
|
---|
41 | 'start')
|
---|
42 | test $verbose = 1 && echo "Starting $NAME"
|
---|
43 | $DAEMON start
|
---|
44 | rval=$?
|
---|
45 | exit $rval
|
---|
46 | ;;
|
---|
47 |
|
---|
48 | stop)
|
---|
49 | test $verbose = 1 && echo "Stopping $NAME"
|
---|
50 | $DAEMON stop
|
---|
51 | rval=$?
|
---|
52 | #
|
---|
53 | # Remove a stale lockfile, if found
|
---|
54 | #
|
---|
55 | if test -f @mylockfile@; then
|
---|
56 | /bin/rm -f @mylockfile@
|
---|
57 | fi
|
---|
58 | exit $rval
|
---|
59 | ;;
|
---|
60 |
|
---|
61 | restart)
|
---|
62 | test $verbose = 1 && echo "Restarting $NAME"
|
---|
63 | $DAEMON restart
|
---|
64 | rval=$?
|
---|
65 | exit $rval
|
---|
66 | ;;
|
---|
67 |
|
---|
68 | reload|force-reload)
|
---|
69 | test $verbose = 1 && echo "Reloading $NAME"
|
---|
70 | $DAEMON reload
|
---|
71 | rval=$?
|
---|
72 | exit $rval
|
---|
73 | ;;
|
---|
74 |
|
---|
75 | status)
|
---|
76 | ${DAEMON} status
|
---|
77 | ERRNUM=$?
|
---|
78 | log_stat_msg ${ERRNUM}
|
---|
79 | exit ${ERRNUM}
|
---|
80 | ;;
|
---|
81 |
|
---|
82 | *)
|
---|
83 | echo "Usage: @install_name@ {start|stop|restart|reload}"
|
---|
84 | exit 1
|
---|
85 | ;;
|
---|
86 | esac
|
---|
87 |
|
---|
88 | exit $rval
|
---|
Note:
See
TracBrowser
for help on using the repository browser.