8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

Updated startup script from Philippe Makowski

This commit is contained in:
alexpeshkoff 2009-07-21 11:16:57 +00:00
parent e5ec513448
commit 607719c547

View File

@ -5,10 +5,10 @@
# #
# This file belongs in /etc/init.d where it will be run # This file belongs in /etc/init.d where it will be run
# on system startup and shutdown to start the background # on system startup and shutdown to start the background
# Firebird/interbase database server daemon # Firebird database server daemon
# Source function library - RedHat or Mandriva specific # Source function library - RedHat or Mandriva specific
# functions actually used: checkpid success failure # functions actually used: checkpid killproc daemon
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
# To run more instances of firebird: # To run more instances of firebird:
@ -21,6 +21,7 @@ INSTANCE=default
FIREBIRD=@prefix@ FIREBIRD=@prefix@
# No changes needed below for multiple instances # No changes needed below for multiple instances
name=firebird_$INSTANCE
FBRunUser=firebird FBRunUser=firebird
pidfile=/var/run/firebird/$INSTANCE.pid pidfile=/var/run/firebird/$INSTANCE.pid
FULLNAME="Firebird server [$INSTANCE]" FULLNAME="Firebird server [$INSTANCE]"
@ -28,6 +29,7 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
MANAGER=$FIREBIRD/bin/fbmgr.bin MANAGER=$FIREBIRD/bin/fbmgr.bin
export FIREBIRD LD_LIBRARY_PATH export FIREBIRD LD_LIBRARY_PATH
RETVAL=0
# Check the file is there and is executable. # Check the file is there and is executable.
[ -x $MANAGER ] || exit 1 [ -x $MANAGER ] || exit 1
@ -36,21 +38,23 @@ export FIREBIRD LD_LIBRARY_PATH
case "$1" in case "$1" in
start) start)
echo -n "Starting $FULLNAME " echo -n "Starting $FULLNAME "
echo $MANAGER -pidfile $pidfile -start -forever | su $FBRunUser daemon --user=$FBRunUser "export FIREBIRD LD_LIBRARY_PATH; $MANAGER -pidfile $pidfile -start -forever"
RETVAL=$? RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
echo echo
;; ;;
stop) stop)
echo -n "Stopping $FULLNAME "
if [ -f $pidfile ] if [ -f $pidfile ]
then then
kill `cat $pidfile` echo -n "Stopping $FULLNAME: "
killproc -p $pidfile $name
RETVAL=$?
echo
else
echo -n "$FULLNAME is stopped"
echo
fi fi
RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
[ $RETVAL -eq 0 ] && success || failure
echo
;; ;;
status) status)
if [ -f $pidfile ] if [ -f $pidfile ]
@ -70,7 +74,7 @@ case "$1" in
RETVAL=$? RETVAL=$?
;; ;;
*) *)
echo "Usage: firebird {start|stop|status|restart|reload}" echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1 exit 1
esac esac