3 # description: Start/Stop firebird database server
5 # To run more instances of firebird:
6 # Copy /opt/firebird somewhere
7 # Copy this script under a new name
8 # Change INSTANCE and FIREBIRD below (all instance names should be unique)
9 # Edit the copied firebird.conf to change at least RemoteServicePort
15 FIREBIRD
=/opt
/firebird
16 DAEMON_NAME
=`basename $0`
18 # No changes needed below for multiple instances
24 if [ ! -d $mDir ]; then
31 chown
$FBRunUser:$FBRunUser $mDir
33 runDir
=/var
/run
/firebird
36 makeFbDir
$lockDir 0770
38 pidfile
="$runDir/$INSTANCE.pid"
39 FULLNAME
="Firebird server [$INSTANCE]"
40 LD_LIBRARY_PATH
=$FIREBIRD/lib
42 export FIREBIRD LD_LIBRARY_PATH
44 GUARDIAN
=$FIREBIRD/bin
/fbguard
45 if [ ! -x $GUARDIAN ]; then
46 GUARDIAN
=/opt
/firebird
/bin
/fbguard
49 # See how we were called.
52 stat_busy
"Starting $FULLNAME"
53 echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su
-s /bin
/sh
$FBRunUser
54 #su $FBRunUser "$GUARDIAN -pidfile $pidfile -daemon -forever"
56 if [ $RETVAL -gt 0 ]; then
59 add_daemon
$DAEMON_NAME
64 stat_busy
"Stopping $FULLNAME"
66 if [ -f $pidfile ]; then
70 if [ $RETVAL -gt 0 ]; then
73 rm_daemon
$DAEMON_NAME
81 ps
-p $pid >/dev
/null
2>&1
88 echo "$FULLNAME is running, pid $pid"
90 echo "$FULLNAME is stopped."
99 echo "Usage: firebird {start|stop|status|restart|reload}"