Last change
on this file since 255 was 59, checked in by rainer, 18 years ago |
Fix for exit status if database load fails; fix for problem with GrowingLogFiles if signed database is used; better support for *BSD init script installation.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | SBINDIR=@sbindir@
|
---|
| 4 | NAME=@install_name@
|
---|
| 5 |
|
---|
| 6 | if [ ! -f ${SBINDIR}/${NAME} ]; then
|
---|
| 7 | exit 0
|
---|
| 8 | fi
|
---|
| 9 |
|
---|
| 10 |
|
---|
[59] | 11 | log_stat_msg() {
|
---|
[1] | 12 | case "$1" in
|
---|
| 13 | 0)
|
---|
| 14 | echo "Service $NAME: Running";
|
---|
| 15 | break;
|
---|
| 16 | ;;
|
---|
| 17 | 1)
|
---|
| 18 | echo "Service $NAME: Stopped and /var/run pid file exists";
|
---|
| 19 | break;
|
---|
| 20 | ;;
|
---|
| 21 | 3)
|
---|
| 22 | echo "Service $NAME: Stopped";
|
---|
| 23 | break;
|
---|
| 24 | ;;
|
---|
| 25 | *)
|
---|
| 26 | echo "Service $NAME: Status unknown";
|
---|
| 27 | break;
|
---|
| 28 | ;;
|
---|
| 29 | esac
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | case "$1" in
|
---|
| 34 | start)
|
---|
| 35 | echo "${NAME} starting."
|
---|
| 36 | ;;
|
---|
| 37 | stop)
|
---|
| 38 | echo "${NAME} stopping."
|
---|
| 39 | ;;
|
---|
| 40 | restart)
|
---|
| 41 | echo "${NAME} restarting."
|
---|
| 42 | ;;
|
---|
| 43 | reload|force-reload)
|
---|
| 44 | echo "${NAME} reloading."
|
---|
| 45 | ;;
|
---|
| 46 | status)
|
---|
| 47 | ${SBINDIR}/${NAME} $1
|
---|
| 48 | ERRNUM=$?
|
---|
| 49 | log_stat_msg ${ERRNUM}
|
---|
| 50 | exit ${ERRNUM}
|
---|
| 51 | ;;
|
---|
| 52 | *)
|
---|
| 53 | echo "Usage: $0 {start|stop|restart|reload|status}"
|
---|
| 54 | exit 1
|
---|
| 55 | ;;
|
---|
| 56 | esac
|
---|
| 57 |
|
---|
| 58 | ${SBINDIR}/${NAME} $1
|
---|
| 59 |
|
---|
| 60 | status=$?
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | if [ $status != 0 ]; then
|
---|
| 64 | echo $status
|
---|
| 65 | exit 1
|
---|
| 66 | fi
|
---|
| 67 |
|
---|
| 68 | case "$1" in
|
---|
| 69 | stop)
|
---|
| 70 | if test -f @mylockfile@; then
|
---|
| 71 | /bin/rm -f @mylockfile@
|
---|
| 72 | fi
|
---|
| 73 | /bin/rm -f @mylockdir@/${NAME}.sock
|
---|
| 74 | ;;
|
---|
| 75 | *)
|
---|
| 76 | exit 0
|
---|
| 77 | ;;
|
---|
| 78 | esac
|
---|
| 79 |
|
---|
| 80 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.