mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 14:03:07 +01:00
Fix up Linux scripts
This commit is contained in:
parent
64c8ed0dfe
commit
a518960783
@ -44,7 +44,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Check is server is being actively used.
|
# Check is server is being actively used.
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fbserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -53,7 +53,7 @@ checkIfServerRunning() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(gds_inet_server|gds_pipe)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fb_inet_server|gds_pipe)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -66,7 +66,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Stop lock manager if it is the only thing running.
|
# Stop lock manager if it is the only thing running.
|
||||||
|
|
||||||
for i in `ps -efww | grep "gds_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
for i in `ps -efww | grep "fb_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
||||||
do
|
do
|
||||||
kill $i
|
kill $i
|
||||||
done
|
done
|
||||||
@ -165,7 +165,7 @@ EOF
|
|||||||
updateInetdEntry() {
|
updateInetdEntry() {
|
||||||
|
|
||||||
FileName=/etc/inetd.conf
|
FileName=/etc/inetd.conf
|
||||||
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/gds_inet_server gds_inet_server # InterBase Database Remote Server"
|
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/fb_inet_server fb_inet_server # InterBase Database Remote Server"
|
||||||
oldLine=`grep "^gds_db" $FileName`
|
oldLine=`grep "^gds_db" $FileName`
|
||||||
|
|
||||||
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
||||||
@ -243,7 +243,7 @@ fixFilePermissions() {
|
|||||||
|
|
||||||
# SUID is still needed for group direct access. General users
|
# SUID is still needed for group direct access. General users
|
||||||
# cannot run though.
|
# cannot run though.
|
||||||
for i in gds_lock_mgr gds_drop gds_inet_server
|
for i in fb_lock_mgr gds_drop fb_inet_server
|
||||||
do
|
do
|
||||||
chmod ug=rx,o= $i
|
chmod ug=rx,o= $i
|
||||||
chmod ug+s $i
|
chmod ug+s $i
|
||||||
@ -260,9 +260,9 @@ fixFilePermissions() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
chmod ug=rw,o= interbase.log
|
chmod ug=rw,o= firebird.log
|
||||||
|
|
||||||
chmod a=r interbase.msg
|
chmod a=r firebird.msg
|
||||||
chmod ug=rw,o= help/help.fdb
|
chmod ug=rw,o= help/help.fdb
|
||||||
chmod ug=rw,o= security.fdb
|
chmod ug=rw,o= security.fdb
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ fixFilePermissions() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# make examples db's writable by group
|
# make examples db's writable by group
|
||||||
chmod ug=rw,o= *.gdb
|
chmod ug=rw,o= *.fdb
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ resetInetdServer() {
|
|||||||
|
|
||||||
#= Main Program ============================================================
|
#= Main Program ============================================================
|
||||||
|
|
||||||
IBRootDir=/opt/interbase
|
IBRootDir=/usr/local/firebird
|
||||||
IBBin=$IBRootDir/bin
|
IBBin=$IBRootDir/bin
|
||||||
|
|
||||||
|
|
||||||
@ -362,11 +362,11 @@ resetInetdServer
|
|||||||
|
|
||||||
cd $IBRootDir
|
cd $IBRootDir
|
||||||
|
|
||||||
touch interbase.log
|
touch firebird.log
|
||||||
chmod ug=rw,o= interbase.log
|
chmod ug=rw,o= firebird.log
|
||||||
|
|
||||||
|
|
||||||
# make examples writable by group
|
# make examples writable by group
|
||||||
chmod ug=rw,o= examples/*.gdb
|
chmod ug=rw,o= examples/*.fdb
|
||||||
|
|
||||||
echo "Completed."
|
echo "Completed."
|
||||||
|
@ -44,7 +44,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Check is server is being actively used.
|
# Check is server is being actively used.
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fbserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -53,7 +53,7 @@ checkIfServerRunning() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(gds_inet_server|gds_pipe)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fb_inet_server|gds_pipe)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -66,7 +66,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Stop lock manager if it is the only thing running.
|
# Stop lock manager if it is the only thing running.
|
||||||
|
|
||||||
for i in `ps -efww | grep "gds_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
for i in `ps -efww | grep "fb_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
||||||
do
|
do
|
||||||
kill $i
|
kill $i
|
||||||
done
|
done
|
||||||
@ -155,7 +155,7 @@ EOF
|
|||||||
updateInetdEntry() {
|
updateInetdEntry() {
|
||||||
|
|
||||||
FileName=/etc/inetd.conf
|
FileName=/etc/inetd.conf
|
||||||
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/gds_inet_server gds_inet_server # InterBase Database Remote Server"
|
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/fb_inet_server fb_inet_server # InterBase Database Remote Server"
|
||||||
oldLine=`grep "^gds_db" $FileName`
|
oldLine=`grep "^gds_db" $FileName`
|
||||||
|
|
||||||
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
||||||
@ -211,7 +211,7 @@ resetInetdServer() {
|
|||||||
#== Main Start ==============================================================
|
#== Main Start ==============================================================
|
||||||
|
|
||||||
|
|
||||||
IBRootDir=/opt/interbase
|
IBRootDir=/usr/local/firebird
|
||||||
IBBin=$IBRootDir/bin
|
IBBin=$IBRootDir/bin
|
||||||
|
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ echo "Updating /etc/services file"
|
|||||||
|
|
||||||
|
|
||||||
FileName=/etc/inetd.conf
|
FileName=/etc/inetd.conf
|
||||||
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/gds_inet_server gds_inet_server # InterBase Database Remote Server"
|
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/fb_inet_server fb_inet_server # InterBase Database Remote Server"
|
||||||
oldLine=`grep "^gds_db" $FileName`
|
oldLine=`grep "^gds_db" $FileName`
|
||||||
|
|
||||||
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
||||||
@ -284,7 +284,7 @@ chmod o=rx *
|
|||||||
|
|
||||||
# SUID is needed for running server programs.
|
# SUID is needed for running server programs.
|
||||||
|
|
||||||
for i in gds_lock_mgr gds_drop gds_inet_server
|
for i in fb_lock_mgr gds_drop fb_inet_server
|
||||||
do
|
do
|
||||||
chmod ug+s $i
|
chmod ug+s $i
|
||||||
done
|
done
|
||||||
@ -305,13 +305,13 @@ for i in isc_init1 isc_lock1 isc_event1
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
touch interbase.log
|
touch firebird.log
|
||||||
chmod ugo=rw interbase.log
|
chmod ugo=rw firebird.log
|
||||||
|
|
||||||
|
|
||||||
# make databases writable by all
|
# make databases writable by all
|
||||||
chmod ugo=rw examples/*.gdb
|
chmod ugo=rw examples/*.fdb
|
||||||
chmod ugo=rw help/*.gdb
|
chmod ugo=rw help/*.fdb
|
||||||
chmod ugo=rw security.fdb
|
chmod ugo=rw security.fdb
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ checkInstallUser() {
|
|||||||
|
|
||||||
stopServerIfRunning() {
|
stopServerIfRunning() {
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fbserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -64,7 +64,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Check is server is being actively used.
|
# Check is server is being actively used.
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fbserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -73,7 +73,7 @@ checkIfServerRunning() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(gds_inet_server|gds_pipe)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fb_inet_server|gds_pipe)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -86,7 +86,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Stop lock manager if it is the only thing running.
|
# Stop lock manager if it is the only thing running.
|
||||||
|
|
||||||
for i in `ps -efww | grep "gds_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
for i in `ps -efww | grep "fb_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
||||||
do
|
do
|
||||||
kill $i
|
kill $i
|
||||||
done
|
done
|
||||||
@ -173,7 +173,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IBRootDir=/opt/interbase
|
IBRootDir=/usr/local/firebird
|
||||||
IBBin=$IBRootDir/bin
|
IBBin=$IBRootDir/bin
|
||||||
|
|
||||||
|
|
||||||
@ -250,13 +250,13 @@ chmod o=rx qli
|
|||||||
|
|
||||||
cd $IBRootDir
|
cd $IBRootDir
|
||||||
|
|
||||||
touch interbase.log
|
touch firebird.log
|
||||||
chmod ug=rw,o= interbase.log
|
chmod ug=rw,o= firebird.log
|
||||||
chmod ug=rw,o=r interbase.msg
|
chmod ug=rw,o=r firebird.msg
|
||||||
|
|
||||||
|
|
||||||
# make examples writable by group
|
# make examples writable by group
|
||||||
chmod ug=rw,o= examples/*.gdb
|
chmod ug=rw,o= examples/*.fdb
|
||||||
|
|
||||||
|
|
||||||
changeInitRunUser $RunUser
|
changeInitRunUser $RunUser
|
||||||
|
@ -43,7 +43,7 @@ checkInstallUser() {
|
|||||||
|
|
||||||
stopServerIfRunning() {
|
stopServerIfRunning() {
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fbserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -64,7 +64,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Check is server is being actively used.
|
# Check is server is being actively used.
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(ibserver|ibguard)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fserver|fbguard)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -73,7 +73,7 @@ checkIfServerRunning() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkString=`ps -efww| egrep "(gds_inet_server|gds_pipe)" |grep -v grep`
|
checkString=`ps -efww| egrep "(fb_inet_server|gds_pipe)" |grep -v grep`
|
||||||
|
|
||||||
if [ ! -z "$checkString" ]
|
if [ ! -z "$checkString" ]
|
||||||
then
|
then
|
||||||
@ -86,7 +86,7 @@ checkIfServerRunning() {
|
|||||||
|
|
||||||
# Stop lock manager if it is the only thing running.
|
# Stop lock manager if it is the only thing running.
|
||||||
|
|
||||||
for i in `ps -efww | grep "gds_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
for i in `ps -efww | grep "fb_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
||||||
do
|
do
|
||||||
kill $i
|
kill $i
|
||||||
done
|
done
|
||||||
@ -173,7 +173,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IBRootDir=/opt/interbase
|
IBRootDir=/usr/local/firebird
|
||||||
IBBin=$IBRootDir/bin
|
IBBin=$IBRootDir/bin
|
||||||
|
|
||||||
|
|
||||||
@ -240,12 +240,12 @@ chmod o=rx qli
|
|||||||
|
|
||||||
cd $IBRootDir
|
cd $IBRootDir
|
||||||
|
|
||||||
touch interbase.log
|
touch firebird.log
|
||||||
chmod ug=rw,o= interbase.log
|
chmod ug=rw,o= firebird.log
|
||||||
|
|
||||||
|
|
||||||
# make examples writable by group
|
# make examples writable by group
|
||||||
chmod ug=rw,o= examples/*.gdb
|
chmod ug=rw,o= examples/*.fdb
|
||||||
|
|
||||||
|
|
||||||
changeInitRunUser $RunUser
|
changeInitRunUser $RunUser
|
||||||
|
@ -54,9 +54,9 @@ generateNewDBAPassword() {
|
|||||||
echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile
|
echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile
|
||||||
echo "" >> $DBAPasswordFile
|
echo "" >> $DBAPasswordFile
|
||||||
echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile
|
echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile
|
||||||
echo "/opt/interbase/bin/gsec program as show below:" >> $DBAPasswordFile
|
echo "/usr/local/firebird/bin/gsec program as show below:" >> $DBAPasswordFile
|
||||||
echo "" >> $DBAPasswordFile
|
echo "" >> $DBAPasswordFile
|
||||||
echo ">cd /opt/interbase" >> $DBAPasswordFile
|
echo ">cd /usr/local/firebird" >> $DBAPasswordFile
|
||||||
echo ">bin/gsec -user sysdba -password <password>" >> $DBAPasswordFile
|
echo ">bin/gsec -user sysdba -password <password>" >> $DBAPasswordFile
|
||||||
echo "GSEC>modify sysdba -pw <newpassword>" >> $DBAPasswordFile
|
echo "GSEC>modify sysdba -pw <newpassword>" >> $DBAPasswordFile
|
||||||
echo "GSEC>quit" >> $DBAPasswordFile
|
echo "GSEC>quit" >> $DBAPasswordFile
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
: ${INTERBASE:=/opt/interbase}
|
: ${INTERBASE:=/usr/local/firebird}
|
||||||
: ${ISC_USER:=SYSDBA}
|
: ${ISC_USER:=SYSDBA}
|
||||||
: ${ISC_PASSWORD:=masterkey}
|
: ${ISC_PASSWORD:=masterkey}
|
||||||
: ${FBRunUser:=root}
|
: ${FBRunUser:=root}
|
||||||
@ -26,7 +26,7 @@ export ISC_PASSWORD
|
|||||||
|
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
[ -x $INTERBASE/bin/ibmgr ] || exit 0
|
[ -x $INTERBASE/bin/fbmgr ] || exit 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -34,12 +34,12 @@ export ISC_PASSWORD
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting Firebird server: "
|
echo -n "Starting Firebird server: "
|
||||||
echo '$INTERBASE/bin/ibmgr -start -forever' | su $FBRunUser
|
echo '$INTERBASE/bin/fbmgr -start -forever' | su $FBRunUser
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping Firebird server: "
|
echo -n "Stopping Firebird server: "
|
||||||
$INTERBASE/bin/ibmgr -shut
|
$INTERBASE/bin/fbmgr -shut
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd
|
||||||
;;
|
;;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
|
||||||
: ${INTERBASE:=/opt/interbase}
|
: ${INTERBASE:=/usr/local/firebird}
|
||||||
: ${ISC_USER:=SYSDBA}
|
: ${ISC_USER:=SYSDBA}
|
||||||
: ${ISC_PASSWORD:=masterkey}
|
: ${ISC_PASSWORD:=masterkey}
|
||||||
: ${FBRunUser:=root}
|
: ${FBRunUser:=root}
|
||||||
@ -32,7 +32,7 @@ export ISC_PASSWORD
|
|||||||
|
|
||||||
|
|
||||||
# Check the file is there and is executable.
|
# Check the file is there and is executable.
|
||||||
[ -x $INTERBASE/bin/ibmgr ] || exit 0
|
[ -x $INTERBASE/bin/fbmgr ] || exit 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -40,20 +40,20 @@ export ISC_PASSWORD
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting Firebird server: "
|
echo -n "Starting Firebird server: "
|
||||||
daemon --user $FBRunUser $INTERBASE/bin/ibmgr -start -forever
|
daemon --user $FBRunUser $INTERBASE/bin/fbmgr -start -forever
|
||||||
# echo '$INTERBASE/bin/ibmgr -start -forever' | su $FBRunUser
|
# echo '$INTERBASE/bin/ibmgr -start -forever' | su $FBRunUser
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping Firebird server: "
|
echo -n "Stopping Firebird server: "
|
||||||
$INTERBASE/bin/ibmgr -shut
|
$INTERBASE/bin/fbmgr -shut
|
||||||
# killproc ibserver
|
# killproc ibserver
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
# echo
|
# echo
|
||||||
# [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd
|
# [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
status ibserver
|
status fbserver
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
|
Loading…
Reference in New Issue
Block a user