| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# chkconfig: 345 20 80 |
| 4 |
# description: Start/Stop firebird database server |
| 5 |
# |
| 6 |
# This file belongs in /etc/init.d where it will be run |
| 7 |
# on system startup and shutdown to start the background |
| 8 |
# Firebird/interbase database server daemon |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
FIREBIRD=@prefix@ |
| 13 |
ISC_USER=SYSDBA |
| 14 |
ISC_PASSWORD=masterkey |
| 15 |
FBRunUser=firebird |
| 16 |
# WARNING: in a real-world installation, you should not put the |
| 17 |
# SYSDBA password in a publicly-readable file. |
| 18 |
# Eventually this file should not need to contain any passwords. |
| 19 |
# as root user alone should be sufficient privledge to stop/start |
| 20 |
# the server. |
| 21 |
|
| 22 |
|
| 23 |
export FIREBIRD |
| 24 |
export ISC_USER |
| 25 |
export ISC_PASSWORD |
| 26 |
|
| 27 |
|
| 28 |
# Check the file is there and is executable. |
| 29 |
[ -x $FIREBIRD/bin/fbmgr ] || exit 0 |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
# See how we were called. |
| 34 |
case "$1" in |
| 35 |
start) |
| 36 |
echo -n "Starting Firebird server: " |
| 37 |
echo '$FIREBIRD/bin/fbmgr -start -forever' | su $FBRunUser |
| 38 |
RETVAL=$? |
| 39 |
;; |
| 40 |
stop) |
| 41 |
echo -n "Stopping Firebird server: " |
| 42 |
$FIREBIRD/bin/fbmgr -shut |
| 43 |
RETVAL=$? |
| 44 |
# [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd |
| 45 |
;; |
| 46 |
status) |
| 47 |
RETVAL=0 |
| 48 |
;; |
| 49 |
restart|reload) |
| 50 |
$0 stop |
| 51 |
$0 start |
| 52 |
RETVAL=$? |
| 53 |
;; |
| 54 |
*) |
| 55 |
echo "Usage: firebird {start|stop|status|restart|reload}" |
| 56 |
exit 1 |
| 57 |
esac |
| 58 |
|
| 59 |
exit $RETVAL |
| 60 |
|