]>
Commit | Line | Data |
---|---|---|
ff2dcfcb AM |
1 | #!/bin/sh |
2 | # | |
3 | # firebird RDBMS | |
4 | # | |
5 | # chkconfig: 2345 80 30 | |
6 | # description: firebird is a database server | |
7 | ||
8 | # Source function library. | |
9 | . /etc/rc.d/init.d/functions | |
10 | ||
11 | # Source networking configuration. | |
12 | . /etc/sysconfig/network | |
13 | ||
14 | ||
535fa407 | 15 | # Source firebird configuration. |
ff2dcfcb AM |
16 | if [ -f /etc/sysconfig/firebird ]; then |
17 | . /etc/sysconfig/firebird | |
18 | fi | |
19 | ||
d8c389bc | 20 | GUARDIAN=/usr/lib/interbase/bin/fbguard |
535fa407 | 21 | PIDFILE=/run/firebird/firebird.pid |
ff2dcfcb AM |
22 | |
23 | # Check that networking is up. | |
24 | if is_yes "${NETWORKING}"; then | |
25 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then | |
26 | msg_network_down firebird | |
27 | exit 1 | |
28 | fi | |
29 | else | |
30 | exit 0 | |
31 | fi | |
32 | ||
c033e0a1 | 33 | start() { |
ff2dcfcb AM |
34 | if [ ! -f /var/lock/subsys/firebird ]; then |
35 | msg_starting firebird | |
d8c389bc | 36 | daemon --user firebird $GUARDIAN -pidfile $PIDFILE -daemon -forever |
ff2dcfcb AM |
37 | RETVAL=$? |
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/firebird | |
39 | else | |
40 | msg_already_running firebird | |
41 | fi | |
c033e0a1 JB |
42 | } |
43 | ||
44 | stop() { | |
ff2dcfcb AM |
45 | if [ -f /var/lock/subsys/firebird ]; then |
46 | msg_stopping firebird | |
d8c389bc | 47 | killproc --pidfile $PIDFILE $GUARDIAN |
ff2dcfcb AM |
48 | rm -f /var/lock/subsys/firebird >/dev/null 2>&1 |
49 | else | |
50 | msg_not_running firebird | |
9ae190ed | 51 | fi |
c033e0a1 JB |
52 | } |
53 | ||
54 | condrestart() { | |
55 | if [ -f /var/lock/subsys/firebird ]; then | |
56 | stop | |
57 | start | |
58 | else | |
59 | msg_not_running firebird | |
60 | RETVAL=$1 | |
61 | fi | |
62 | } | |
63 | ||
64 | RETVAL=0 | |
65 | # See how we were called. | |
66 | case "$1" in | |
67 | start) | |
68 | start | |
ff2dcfcb | 69 | ;; |
c033e0a1 JB |
70 | stop) |
71 | stop | |
72 | ;; | |
73 | restart) | |
74 | stop | |
75 | start | |
76 | ;; | |
77 | try-restart) | |
78 | condrestart 0 | |
79 | ;; | |
80 | force-reload) | |
81 | condrestart 7 | |
ff2dcfcb AM |
82 | ;; |
83 | status) | |
84 | status fb_inet_server | |
85 | exit $? | |
86 | ;; | |
87 | *) | |
c033e0a1 | 88 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" |
ff2dcfcb AM |
89 | exit 3 |
90 | esac | |
91 | ||
92 | exit $RETVAL |