|
25 | 25 | # -------------------- -------------------- |
26 | 26 | # |
27 | 27 | # the path to your PID file |
28 | | -PIDFILE=@prefix@/logs/httpd.pid |
| 28 | +PIDFILE=@prefix@/logs/@progname@.pid |
29 | 29 | # |
30 | 30 | # the path to your httpd binary, including options if necessary |
31 | 31 | HTTPD='@prefix@/bin/@progname@' |
|
54 | 54 | if [ -f $PIDFILE ] ; then |
55 | 55 | PID=`cat $PIDFILE` |
56 | 56 | if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then |
57 | | - STATUS="httpd (pid $PID) running" |
| 57 | + STATUS="@progname@ (pid $PID) running" |
58 | 58 | RUNNING=1 |
59 | 59 | else |
60 | | - STATUS="httpd (pid $PID?) not running" |
| 60 | + STATUS="@progname@ (pid $PID?) not running" |
61 | 61 | RUNNING=0 |
62 | 62 | fi |
63 | 63 | else |
64 | | - STATUS="httpd (no pid file) not running" |
| 64 | + STATUS="@progname@ (no pid file) not running" |
65 | 65 | RUNNING=0 |
66 | 66 | fi |
67 | 67 |
|
68 | 68 | case $ARG in |
69 | 69 | start) |
70 | 70 | if [ $RUNNING -eq 1 ]; then |
71 | | - echo "$0 $ARG: httpd (pid $PID) already running" |
| 71 | + echo "$0 $ARG: @progname@ (pid $PID) already running" |
72 | 72 | continue |
73 | 73 | fi |
74 | 74 | if $HTTPD ; then |
75 | | - echo "$0 $ARG: httpd started" |
| 75 | + echo "$0 $ARG: @progname@ started" |
76 | 76 | else |
77 | | - echo "$0 $ARG: httpd could not be started" |
| 77 | + echo "$0 $ARG: @progname@ could not be started" |
78 | 78 | ERROR=3 |
79 | 79 | fi |
80 | 80 | ;; |
|
84 | 84 | continue |
85 | 85 | fi |
86 | 86 | if kill $PID ; then |
87 | | - echo "$0 $ARG: httpd stopped" |
| 87 | + echo "$0 $ARG: @progname@ stopped" |
88 | 88 | else |
89 | | - echo "$0 $ARG: httpd could not be stopped" |
| 89 | + echo "$0 $ARG: @progname@ could not be stopped" |
90 | 90 | ERROR=4 |
91 | 91 | fi |
92 | 92 | ;; |
93 | 93 | restart) |
94 | 94 | if [ $RUNNING -eq 0 ]; then |
95 | | - echo "$0 $ARG: httpd not running, trying to start" |
| 95 | + echo "$0 $ARG: @progname@ not running, trying to start" |
96 | 96 | if $HTTPD ; then |
97 | | - echo "$0 $ARG: httpd started" |
| 97 | + echo "$0 $ARG: @progname@ started" |
98 | 98 | else |
99 | | - echo "$0 $ARG: httpd could not be started" |
| 99 | + echo "$0 $ARG: @progname@ could not be started" |
100 | 100 | ERROR=5 |
101 | 101 | fi |
102 | 102 | else |
103 | 103 | if $HTTPD -t >/dev/null 2>&1; then |
104 | 104 | if kill -HUP $PID ; then |
105 | | - echo "$0 $ARG: httpd restarted" |
| 105 | + echo "$0 $ARG: @progname@ restarted" |
106 | 106 | else |
107 | | - echo "$0 $ARG: httpd could not be restarted" |
| 107 | + echo "$0 $ARG: @progname@ could not be restarted" |
108 | 108 | ERROR=6 |
109 | 109 | fi |
110 | 110 | else |
|
116 | 116 | ;; |
117 | 117 | graceful) |
118 | 118 | if [ $RUNNING -eq 0 ]; then |
119 | | - echo "$0 $ARG: httpd not running, trying to start" |
| 119 | + echo "$0 $ARG: @progname@ not running, trying to start" |
120 | 120 | if $HTTPD ; then |
121 | | - echo "$0 $ARG: httpd started" |
| 121 | + echo "$0 $ARG: @progname@ started" |
122 | 122 | else |
123 | | - echo "$0 $ARG: httpd could not be started" |
| 123 | + echo "$0 $ARG: @progname@ could not be started" |
124 | 124 | ERROR=5 |
125 | 125 | fi |
126 | 126 | else |
127 | 127 | if $HTTPD -t >/dev/null 2>&1; then |
128 | 128 | if kill -@AP_SIG_GRACEFUL_SHORT@ $PID ; then |
129 | | - echo "$0 $ARG: httpd gracefully restarted" |
| 129 | + echo "$0 $ARG: @progname@ gracefully restarted" |
130 | 130 | else |
131 | | - echo "$0 $ARG: httpd could not be restarted" |
| 131 | + echo "$0 $ARG: @progname@ could not be restarted" |
132 | 132 | ERROR=7 |
133 | 133 | fi |
134 | 134 | else |
|
155 | 155 | echo "usage: $0 (start|stop|restart|fullstatus|status|graceful|configtest|help)" |
156 | 156 | cat <<EOF |
157 | 157 |
|
158 | | -start - start httpd |
159 | | -stop - stop httpd |
160 | | -restart - restart httpd if running by sending a SIGHUP or start if |
| 158 | +start - start @progname@ |
| 159 | +stop - stop @progname@ |
| 160 | +restart - restart @progname@ if running by sending a SIGHUP or start if |
161 | 161 | not running |
162 | 162 | fullstatus - dump a full status screen; requires lynx and mod_status enabled |
163 | 163 | status - dump a short status screen; requires lynx and mod_status enabled |
|
0 commit comments