]> git.pld-linux.org Git - packages/Firebird.git/blob - firebird.init
- updated quickstartguide.pdf md5 sum
[packages/Firebird.git] / firebird.init
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
15 # Source firebird configuration.
16 if [ -f /etc/sysconfig/firebird ]; then
17         . /etc/sysconfig/firebird
18 fi
19
20 GUARDIAN=/usr/lib/interbase/bin/fbguard
21 PIDFILE=/run/firebird/firebird.pid
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
33 start() {
34         if [ ! -f /var/lock/subsys/firebird ]; then
35                 msg_starting firebird
36                 daemon --user firebird $GUARDIAN -pidfile $PIDFILE -daemon -forever
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/firebird
39         else
40                 msg_already_running firebird
41         fi
42 }
43
44 stop() {
45         if [ -f /var/lock/subsys/firebird ]; then
46                 msg_stopping firebird
47                 killproc --pidfile $PIDFILE $GUARDIAN
48                 rm -f /var/lock/subsys/firebird >/dev/null 2>&1
49         else
50                 msg_not_running firebird
51         fi
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
69         ;;
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
82         ;;
83   status)
84         status fb_inet_server
85         exit $?
86         ;;
87   *)
88         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
89         exit 3
90 esac
91
92 exit $RETVAL
This page took 0.085623 seconds and 3 git commands to generate.