source: trunk/init/samhain.startSolaris.in @ 321

Last change on this file since 321 was 59, checked in by rainer, 15 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
Line 
1#!/bin/sh
2
3SBINDIR=@sbindir@
4NAME=@install_name@
5
6if [ ! -f ${SBINDIR}/${NAME} ]; then
7        exit 0
8fi
9
10
11log_stat_msg() {
12case "$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        ;;
29esac
30}
31
32
33case "$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        ;;
56esac
57
58${SBINDIR}/${NAME}  $1
59
60status=$?
61
62
63if [ $status != 0 ]; then
64    echo $status
65    exit 1
66fi
67
68case "$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        ;;
78esac
79
80exit 0
Note: See TracBrowser for help on using the repository browser.