mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed CORE-5053: changeServerMode.sh can mess with configuration
This commit is contained in:
parent
df55756907
commit
d54d2d46f8
@ -63,16 +63,16 @@ fi
|
|||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting Firebird server: "
|
printf %s "Starting Firebird server: "
|
||||||
start-stop-daemon --start --quiet --oknodo --chuid $FBRunUser --exec $GUARDIAN -- $FB_OPTS
|
start-stop-daemon --start --quiet --oknodo --chuid $FBRunUser --exec $GUARDIAN -- $FB_OPTS
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
if pidof $GUARDIAN > /dev/null; then
|
if pidof $GUARDIAN > /dev/null; then
|
||||||
echo -n "Stopping Guardian server: "
|
printf %s "Stopping Guardian server: "
|
||||||
start-stop-daemon --stop --quiet --oknodo --retry 10 --exec $GUARDIAN
|
start-stop-daemon --stop --quiet --oknodo --retry 10 --exec $GUARDIAN
|
||||||
fi
|
fi
|
||||||
echo -n "Stopping Firebird server: "
|
printf %s "Stopping Firebird server: "
|
||||||
if [ -f $pidfile ]
|
if [ -f $pidfile ]
|
||||||
then
|
then
|
||||||
kill `cat $pidfile`
|
kill `cat $pidfile`
|
||||||
@ -85,7 +85,7 @@ case "$1" in
|
|||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
shutdown)
|
shutdown)
|
||||||
echo -n "Forcibly killing Firebird server..."
|
printf %s "Forcibly killing Firebird server..."
|
||||||
killall fbguard
|
killall fbguard
|
||||||
killall firebird
|
killall firebird
|
||||||
echo "done."
|
echo "done."
|
||||||
|
@ -48,12 +48,12 @@ fi
|
|||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting $FULLNAME: "
|
printf %s "Starting $FULLNAME: "
|
||||||
echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su $FBRunUser
|
echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su $FBRunUser
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping $FULLNAME: "
|
printf %s "Stopping $FULLNAME: "
|
||||||
if [ -f $pidfile ]
|
if [ -f $pidfile ]
|
||||||
then
|
then
|
||||||
kill `cat $pidfile`
|
kill `cat $pidfile`
|
||||||
|
@ -138,13 +138,13 @@ detectDistro() {
|
|||||||
getInitScriptLocation() {
|
getInitScriptLocation() {
|
||||||
if [ -f /etc/rc.d/init.d/firebird ]
|
if [ -f /etc/rc.d/init.d/firebird ]
|
||||||
then
|
then
|
||||||
echo -n /etc/rc.d/init.d/firebird
|
printf %s /etc/rc.d/init.d/firebird
|
||||||
elif [ -f /etc/rc.d/rc.firebird ]
|
elif [ -f /etc/rc.d/rc.firebird ]
|
||||||
then
|
then
|
||||||
echo -n /etc/rc.d/rc.firebird
|
printf %s /etc/rc.d/rc.firebird
|
||||||
elif [ -f /etc/init.d/firebird ]
|
elif [ -f /etc/init.d/firebird ]
|
||||||
then
|
then
|
||||||
echo -n /etc/init.d/firebird
|
printf %s /etc/init.d/firebird
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ removeServiceAutostart
|
|||||||
|
|
||||||
echo "Starting firebird in $multiAnswer server mode..."
|
echo "Starting firebird in $multiAnswer server mode..."
|
||||||
fbconf="@FB_CONFDIR@/firebird.conf"
|
fbconf="@FB_CONFDIR@/firebird.conf"
|
||||||
if [ $multiAnswer == classic ]; then
|
if [ $multiAnswer = classic ]; then
|
||||||
replaceLineInFile $fbconf "ServerMode = Classic" "^ServerMode"
|
replaceLineInFile $fbconf "ServerMode = Classic" "^ServerMode"
|
||||||
|
|
||||||
updateInetdServiceEntry
|
updateInetdServiceEntry
|
||||||
|
@ -72,7 +72,7 @@ MakeTemp() {
|
|||||||
AskQuestion() {
|
AskQuestion() {
|
||||||
Test=$1
|
Test=$1
|
||||||
DefaultAns=$2
|
DefaultAns=$2
|
||||||
echo -n "$Test"
|
printf %s "$Test"
|
||||||
Answer="$DefaultAns"
|
Answer="$DefaultAns"
|
||||||
read Answer
|
read Answer
|
||||||
|
|
||||||
@ -87,8 +87,9 @@ AskQuestion() {
|
|||||||
# Prompt for yes or no answer - returns non-zero for no
|
# Prompt for yes or no answer - returns non-zero for no
|
||||||
|
|
||||||
AskYNQuestion() {
|
AskYNQuestion() {
|
||||||
while echo -n "${*} (y/n): "
|
while true
|
||||||
do
|
do
|
||||||
|
printf %s "${*} (y/n): "
|
||||||
read answer rest
|
read answer rest
|
||||||
case $answer in
|
case $answer in
|
||||||
[yY]*)
|
[yY]*)
|
||||||
|
Loading…
Reference in New Issue
Block a user