- added -FHS.patch (moved {aliases,firebird}.conf files to /etc/firebird
[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 oident configureation.
16 if [ -f /etc/sysconfig/firebird ]; then
17         . /etc/sysconfig/firebird
18 fi
19
20 DAEMON=/usr/lib/interbase/bin/fbmgr.bin
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 msg_network_down firebird
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 start() {
33         if [ ! -f /var/lock/subsys/firebird ]; then
34                 msg_starting firebird
35                 daemon --user firebird $DAEMON -start -forever
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/firebird
38         else
39                 msg_already_running firebird
40         fi
41 }
42
43 stop() {
44         if [ -f /var/lock/subsys/firebird ]; then
45                 msg_stopping firebird
46                 daemon --user firebird $DAEMON -shut
47                 rm -f /var/lock/subsys/firebird >/dev/null 2>&1
48         else
49                 msg_not_running firebird
50         fi
51 }
52
53 condrestart() {
54         if [ -f /var/lock/subsys/firebird ]; then
55                 stop
56                 start
57         else
58                 msg_not_running firebird
59                 RETVAL=$1
60         fi
61 }
62
63 RETVAL=0
64 # See how we were called.
65 case "$1" in
66   start)
67         start
68         ;;
69   stop)
70         stop
71         ;;
72   restart)
73         stop
74         start
75         ;;
76   try-restart)
77         condrestart 0
78         ;;
79   force-reload)
80         condrestart 7
81         ;;
82   status)
83         status fb_inet_server
84         exit $?
85         ;;
86   *)
87         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
88         exit 3
89 esac
90
91 exit $RETVAL
This page took 0.034822 seconds and 3 git commands to generate.