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

Use -daemon switch to start fbguard directly - without fbmgr.

This commit is contained in:
alexpeshkoff 2008-04-25 16:37:30 +00:00
parent a7ec61e555
commit f386d5ed7e
6 changed files with 16 additions and 17 deletions

View File

@ -18,19 +18,19 @@
FIREBIRD=@prefix@
FBRunUser=firebird
pidfile=/var/run/firebird/`basename $0`.pid
FB_OPTS="-pidfile $pidfile -start -forever"
FB_OPTS="-pidfile $pidfile -daemon -forever"
export FIREBIRD
# Check the file is there and is executable.
MANAGER=$FIREBIRD/bin/fbmgr.bin
[ -x $MANAGER ] || exit 0
GUARDIAN=$FIREBIRD/bin/fbguard
[ -x $GUARDIAN ] || exit 0
# See how we were called.
case "$1" in
start)
echo -n "Starting Firebird server: "
start-stop-daemon --start --quiet --oknodo --chuid $FBRunUser --exec $MANAGER -- $FB_OPTS
start-stop-daemon --start --quiet --oknodo --chuid $FBRunUser --exec $GUARDIAN -- $FB_OPTS
RETVAL=$?
;;
stop)

View File

@ -18,16 +18,16 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
MANAGER=$FIREBIRD/bin/fbmgr.bin
GUARDIAN=$FIREBIRD/bin/fbguard
# Check the file is there and is executable.
[ -x $MANAGER ] || exit 0
[ -x $GUARDIAN ] || exit 0
# See how we were called.
case "$1" in
start)
echo -n "Starting $FULLNAME: "
echo "$MANAGER -pidfile $pidfile -start -forever" | su $FBRunUser
echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su $FBRunUser
RETVAL=$?
;;
stop)

View File

@ -22,15 +22,15 @@ FBRunUser=firebird
pidfile=/var/run/firebird/$INSTANCE.pid
FULLNAME="firebird server [$INSTANCE]"
LD_LIBRARY_PATH=$FIREBIRD/lib
FB_OPTS="-pidfile $pidfile -start -forever"
FB_OPTS="-pidfile $pidfile -daemon -forever"
export FIREBIRD LD_LIBRARY_PATH
MANAGER=$FIREBIRD/bin/fbmgr.bin
GUARDIAN=$FIREBIRD/bin/fbguard
start(){
ebegin "Starting $FULLNAME"
start-stop-daemon --oknodo --start --pidfile $pidfile --chuid $FBRunUser --startas $MANAGER -- $FB_OPTS
start-stop-daemon --oknodo --start --pidfile $pidfile --chuid $FBRunUser --startas $GUARDIAN -- $FB_OPTS
eend $?
}

View File

@ -29,14 +29,14 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
# Check the file is there and is executable.
[ -x $FIREBIRD/bin/fbmgr.bin ] || exit 1
GUARDIAN=$FIREBIRD/bin/fbguard
# See how we were called.
case "$1" in
start)
echo -n "Starting $FULLNAME "
runuser -s /bin/bash $FBRunUser -c "$FIREBIRD/bin/fbmgr.bin -pidfile $pidfile -start -forever"
runuser -s /bin/bash $FBRunUser -c "$GUARDIAN -pidfile $pidfile -daemon -forever"
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo

View File

@ -22,14 +22,14 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
MANAGER=$FIREBIRD/bin/fbmgr.bin
GUARDIAN=$FIREBIRD/bin/fbguard
# Check the file is there and is executable.
[ -x $MANAGER ] || exit 0
[ -x $GUARDIAN ] || exit 0
case "$1" in
'start') echo -n "Starting $FULLNAME: "
echo $MANAGER -pidfile $pidfile -start -forever | su $FBRunUser ;;
echo $GUARDIAN -pidfile $pidfile -daemon -forever | su $FBRunUser ;;
'stop') echo -n "Stopping $FULLNAME: "
if [ -f $pidfile ]; then kill `cat $pidfile`; echo "done."; else echo "error: no PID file."; fi ;;
'restart') $0 stop ; sleep 1; $0 start ;;

View File

@ -46,8 +46,7 @@ pidfile=/var/run/firebird/firebird.pid
export FIREBIRD
# Check the file is there and is executable.
[ -x $FIREBIRD/bin/fbmgr ] || exit 5
# Check the files are there and are executable.
[ -x $FIREBIRD/bin/fbguard ] || exit 5
[ -x $FIREBIRD/bin/fbserver ] || exit 5