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:
parent
a7ec61e555
commit
f386d5ed7e
@ -18,19 +18,19 @@
|
|||||||
FIREBIRD=@prefix@
|
FIREBIRD=@prefix@
|
||||||
FBRunUser=firebird
|
FBRunUser=firebird
|
||||||
pidfile=/var/run/firebird/`basename $0`.pid
|
pidfile=/var/run/firebird/`basename $0`.pid
|
||||||
FB_OPTS="-pidfile $pidfile -start -forever"
|
FB_OPTS="-pidfile $pidfile -daemon -forever"
|
||||||
export FIREBIRD
|
export FIREBIRD
|
||||||
|
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
MANAGER=$FIREBIRD/bin/fbmgr.bin
|
GUARDIAN=$FIREBIRD/bin/fbguard
|
||||||
[ -x $MANAGER ] || exit 0
|
[ -x $GUARDIAN ] || exit 0
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting Firebird server: "
|
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=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
@ -18,16 +18,16 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
|
|||||||
|
|
||||||
export FIREBIRD LD_LIBRARY_PATH
|
export FIREBIRD LD_LIBRARY_PATH
|
||||||
|
|
||||||
MANAGER=$FIREBIRD/bin/fbmgr.bin
|
GUARDIAN=$FIREBIRD/bin/fbguard
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
[ -x $MANAGER ] || exit 0
|
[ -x $GUARDIAN ] || exit 0
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting $FULLNAME: "
|
echo -n "Starting $FULLNAME: "
|
||||||
echo "$MANAGER -pidfile $pidfile -start -forever" | su $FBRunUser
|
echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su $FBRunUser
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
@ -22,15 +22,15 @@ FBRunUser=firebird
|
|||||||
pidfile=/var/run/firebird/$INSTANCE.pid
|
pidfile=/var/run/firebird/$INSTANCE.pid
|
||||||
FULLNAME="firebird server [$INSTANCE]"
|
FULLNAME="firebird server [$INSTANCE]"
|
||||||
LD_LIBRARY_PATH=$FIREBIRD/lib
|
LD_LIBRARY_PATH=$FIREBIRD/lib
|
||||||
FB_OPTS="-pidfile $pidfile -start -forever"
|
FB_OPTS="-pidfile $pidfile -daemon -forever"
|
||||||
|
|
||||||
export FIREBIRD LD_LIBRARY_PATH
|
export FIREBIRD LD_LIBRARY_PATH
|
||||||
|
|
||||||
MANAGER=$FIREBIRD/bin/fbmgr.bin
|
GUARDIAN=$FIREBIRD/bin/fbguard
|
||||||
|
|
||||||
start(){
|
start(){
|
||||||
ebegin "Starting $FULLNAME"
|
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 $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,14 +29,14 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
|
|||||||
export FIREBIRD LD_LIBRARY_PATH
|
export FIREBIRD LD_LIBRARY_PATH
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
[ -x $FIREBIRD/bin/fbmgr.bin ] || exit 1
|
GUARDIAN=$FIREBIRD/bin/fbguard
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting $FULLNAME "
|
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=$?
|
||||||
[ $RETVAL -eq 0 ] && success || failure
|
[ $RETVAL -eq 0 ] && success || failure
|
||||||
echo
|
echo
|
||||||
|
@ -22,14 +22,14 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
|
|||||||
|
|
||||||
export FIREBIRD LD_LIBRARY_PATH
|
export FIREBIRD LD_LIBRARY_PATH
|
||||||
|
|
||||||
MANAGER=$FIREBIRD/bin/fbmgr.bin
|
GUARDIAN=$FIREBIRD/bin/fbguard
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
[ -x $MANAGER ] || exit 0
|
[ -x $GUARDIAN ] || exit 0
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'start') echo -n "Starting $FULLNAME: "
|
'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: "
|
'stop') echo -n "Stopping $FULLNAME: "
|
||||||
if [ -f $pidfile ]; then kill `cat $pidfile`; echo "done."; else echo "error: no PID file."; fi ;;
|
if [ -f $pidfile ]; then kill `cat $pidfile`; echo "done."; else echo "error: no PID file."; fi ;;
|
||||||
'restart') $0 stop ; sleep 1; $0 start ;;
|
'restart') $0 stop ; sleep 1; $0 start ;;
|
||||||
|
@ -46,8 +46,7 @@ pidfile=/var/run/firebird/firebird.pid
|
|||||||
|
|
||||||
export FIREBIRD
|
export FIREBIRD
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the files are there and are executable.
|
||||||
[ -x $FIREBIRD/bin/fbmgr ] || exit 5
|
|
||||||
[ -x $FIREBIRD/bin/fbguard ] || exit 5
|
[ -x $FIREBIRD/bin/fbguard ] || exit 5
|
||||||
[ -x $FIREBIRD/bin/fbserver ] || exit 5
|
[ -x $FIREBIRD/bin/fbserver ] || exit 5
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user