mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
Added config_root.cpp file for posix.
This commit is contained in:
parent
7cb98409ea
commit
a91efa1ae8
@ -232,7 +232,7 @@ FBCOMMON_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBCOMMON_So
|
||||
#
|
||||
# Platform Manager
|
||||
|
||||
OS_SPECIFIC_Files= path_utils.cpp mod_loader.cpp
|
||||
OS_SPECIFIC_Files= config_root.cpp path_utils.cpp mod_loader.cpp
|
||||
|
||||
OS_SPECIFIC_Sources = $(addprefix $(PLATFORM_PATH)/, $(OS_SPECIFIC_Files))
|
||||
OS_SPECIFIC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(OS_SPECIFIC_Sources))))
|
||||
|
25
configure.in
25
configure.in
@ -1,4 +1,4 @@
|
||||
dnl $Id: configure.in,v 1.62 2002-11-05 13:15:47 kkuznetsov Exp $
|
||||
dnl $Id: configure.in,v 1.63 2002-11-05 16:48:59 skywalker Exp $
|
||||
|
||||
dnl ############################# INITIALISATION ###############################
|
||||
|
||||
@ -237,6 +237,14 @@ AC_CHECK_TYPE(socklen_t,int)
|
||||
AC_SYS_LARGEFILE
|
||||
AC_CHECK_SIZEOF(void*)
|
||||
|
||||
dnl MOD: Check for /proc/self/exe mainly used on linux systems
|
||||
dnl this is used to determine path to executable file.
|
||||
|
||||
AC_MSG_CHECKING(for file /proc/self/exe)
|
||||
AC_CHECK_FILES(/proc/self/exe)
|
||||
|
||||
|
||||
|
||||
dnl EKU: try to determine the alignment of long and double
|
||||
dnl replaces ALIGNMENT and DOUBLE_ALIGN in src/jrd/common.h
|
||||
AC_MSG_CHECKING(alignment of long)
|
||||
@ -462,6 +470,8 @@ mkdir -p gen/libfbembed/common/memory
|
||||
|
||||
MAKE_SRC_DIR=builds/posix
|
||||
|
||||
INSTALL_SRC_DIR=src/install/${FIREBIRD_ARCH_TYPE}
|
||||
|
||||
AC_DEFINE_UNQUOTED(ISC_PREFIX,$(if test "x$prefix" = "xNONE" ; then echo \"$ac_default_prefix\"; else echo \"$prefix\"; fi))
|
||||
|
||||
AC_OUTPUT(
|
||||
@ -505,12 +515,13 @@ gen/Makefile.embed.gpre:${MAKE_SRC_DIR}/Makefile.in.embed.gpre
|
||||
src/v5_examples/Makefile:${MAKE_SRC_DIR}/Makefile.in.example5
|
||||
gen/Makefile.install:${MAKE_SRC_DIR}/Makefile.in.install
|
||||
Makefile:Makefile.in
|
||||
gen/install/scripts/preinstall.sh:src/install/${FIREBIRD_ARCH_TYPE}/preinstall.sh.in
|
||||
gen/install/scripts/install.sh:src/install/${FIREBIRD_ARCH_TYPE}/install.sh.in
|
||||
gen/install/scripts/postinstall.sh:src/install/${FIREBIRD_ARCH_TYPE}/postinstall.sh.in
|
||||
gen/install/scripts/preuninstall.sh:src/install/${FIREBIRD_ARCH_TYPE}/preuninstall.sh.in
|
||||
gen/install/scripts/postuninstall.sh:src/install/${FIREBIRD_ARCH_TYPE}/postuninstall.sh.in
|
||||
gen/install/install.sh:src/install/${FIREBIRD_ARCH_TYPE}/tarInstall.sh.in
|
||||
gen/install/makeInstallImage.sh:${INSTALL_SRC_DIR}/makeInstallImage.sh.in
|
||||
gen/install/scripts/preinstall.sh:${INSTALL_SRC_DIR}/preinstall.sh.in
|
||||
gen/install/scripts/install.sh:${INSTALL_SRC_DIR}/install.sh.in
|
||||
gen/install/scripts/postinstall.sh:${INSTALL_SRC_DIR}/postinstall.sh.in
|
||||
gen/install/scripts/preuninstall.sh:${INSTALL_SRC_DIR}/preuninstall.sh.in
|
||||
gen/install/scripts/postuninstall.sh:${INSTALL_SRC_DIR}/postuninstall.sh.in
|
||||
gen/install/install.sh:${INSTALL_SRC_DIR}/tarInstall.sh.in
|
||||
src/install/misc/firebird.xinetd
|
||||
dnl SINIX-Z start
|
||||
gen/install/sinixz/Makefile:src/install/arch-specific/sinixz/Makefile.in
|
||||
|
@ -70,7 +70,7 @@ addFirebirdUser() {
|
||||
testStr=`grep firebird /etc/passwd`
|
||||
if [ -z "$testDir" ]
|
||||
then
|
||||
useradd -o -r -m -d $FBRootDir -s /bin/bash \
|
||||
useradd -o -r -m -d $IBRootDir -s /bin/bash \
|
||||
-c "Firebird Database Administrator" -g firebird -u 84 firebird
|
||||
|
||||
# >/dev/null 2>&1
|
||||
@ -99,8 +99,8 @@ changeXinetdServiceUser() {
|
||||
InitFile=/etc/xinetd.d/firebird
|
||||
if [ -f $InitFile ]
|
||||
then
|
||||
ed -s $InitFile <<EOF
|
||||
/ user /s/=.*$/= $RunUser/g
|
||||
ex -s $InitFile <<EOF
|
||||
/ user /s/=.*\$/= $RunUser/g
|
||||
w
|
||||
q
|
||||
EOF
|
||||
@ -114,7 +114,7 @@ EOF
|
||||
updateInetdEntry() {
|
||||
|
||||
FileName=/etc/inetd.conf
|
||||
newLine="gds_db stream tcp nowait.30000 $RunUser $FBBin/gds_inet_server gds_inet_server # InterBase Database Remote Server"
|
||||
newLine="gds_db stream tcp nowait.30000 $RunUser $IBBin/gds_inet_server gds_inet_server # InterBase Database Remote Server"
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
|
||||
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
||||
@ -125,7 +125,10 @@ updateInetdEntry() {
|
||||
|
||||
updateXinetdEntry() {
|
||||
|
||||
cp $FBRootDir/misc/firebird.xinetd /etc/xinetd.d/firebird
|
||||
InitFile=/etc/xinetd.d/firebird
|
||||
cp $IBRootDir/misc/firebird.xinetd $InitFile
|
||||
chown root:root $InitFile
|
||||
chmod o=rw,go=r $InitFile
|
||||
changeXinetdServiceUser
|
||||
}
|
||||
|
||||
@ -156,7 +159,7 @@ updateInetdServiceEntry() {
|
||||
|
||||
keepOrigDBAPassword() {
|
||||
|
||||
DBAPasswordFile=$FBRootDir/SYSDBA.password
|
||||
DBAPasswordFile=$IBRootDir/SYSDBA.password
|
||||
|
||||
NewPasswd='masterkey'
|
||||
echo "Firebird initial install password " > $DBAPasswordFile
|
||||
@ -170,7 +173,7 @@ keepOrigDBAPassword() {
|
||||
echo "daemon init routine in the file /etc/init.d/firebird)" >> $DBAPasswordFile
|
||||
echo "" >> $DBAPasswordFile
|
||||
echo "Your should password can be changed to a more suitable one using the" >> $DBAPasswordFile
|
||||
echo "@prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile
|
||||
echo "/opt/interbase/bin/changeDBAPassword.sh script" >> $DBAPasswordFile
|
||||
echo "" >> $DBAPasswordFile
|
||||
|
||||
chmod u=r,go= $DBAPasswordFile
|
||||
@ -186,9 +189,14 @@ keepOrigDBAPassword() {
|
||||
|
||||
generateNewDBAPassword() {
|
||||
|
||||
DBAPasswordFile=$FBRootDir/SYSDBA.password
|
||||
DBAPasswordFile=$IBRootDir/SYSDBA.password
|
||||
|
||||
NewPasswd=`/usr/bin/mkpasswd -l 8`
|
||||
if [ -z "$NewPasswd" ]
|
||||
then
|
||||
keepOrigDBAPassword
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Firebird generated password " > $DBAPasswordFile
|
||||
echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile
|
||||
@ -197,11 +205,11 @@ generateNewDBAPassword() {
|
||||
echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile
|
||||
echo "" >> $DBAPasswordFile
|
||||
echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile
|
||||
echo "@prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile
|
||||
echo "/opt/interbase/bin/changeDBAPassword.sh script" >> $DBAPasswordFile
|
||||
echo "" >> $DBAPasswordFile
|
||||
chmod u=r,go= $DBAPasswordFile
|
||||
|
||||
$FBBin/gsec -user sysdba -password masterkey <<EOF
|
||||
$IBBin/gsec -user sysdba -password masterkey <<EOF
|
||||
modify sysdba -pw $NewPasswd
|
||||
EOF
|
||||
|
||||
@ -219,7 +227,7 @@ askUserForNewDBAPassword() {
|
||||
while [ -z "$NewPasswd" ]
|
||||
do
|
||||
# If using a generated password
|
||||
# DBAPasswordFile=$FBRootDir/SYSDBA.password
|
||||
# DBAPasswordFile=$IBRootDir/SYSDBA.password
|
||||
# NewPasswd=`mkpasswd -l 8`
|
||||
# echo "Password for SYSDBA on `hostname` is : $NewPasswd" > $DBAPasswordFile
|
||||
# chmod ga-rwx $DBAPasswordFile
|
||||
@ -228,7 +236,7 @@ askUserForNewDBAPassword() {
|
||||
NewPasswd=$Answer
|
||||
if [ ! -z "$NewPasswd" ]
|
||||
then
|
||||
$FBBin/gsec -user sysdba -password masterkey <<EOF
|
||||
$IBBin/gsec -user sysdba -password masterkey <<EOF
|
||||
modify sysdba -pw $NewPasswd
|
||||
EOF
|
||||
echo ""
|
||||
@ -274,13 +282,13 @@ changeDBAPassword() {
|
||||
fixFilePermissions() {
|
||||
|
||||
# Turn other access off.
|
||||
chmod -R o= $FBRootDir
|
||||
chmod -R o= $IBRootDir
|
||||
|
||||
|
||||
# Now fix up the mess.
|
||||
|
||||
# fix up directories
|
||||
for i in `find $FBRootDir -print`
|
||||
for i in `find $IBRootDir -print`
|
||||
do
|
||||
FileName=$i
|
||||
if [ -d $FileName ]
|
||||
@ -290,7 +298,7 @@ fixFilePermissions() {
|
||||
done
|
||||
|
||||
|
||||
cd $FBBin
|
||||
cd $IBBin
|
||||
|
||||
|
||||
# set up the defaults for bin
|
||||
@ -315,7 +323,7 @@ fixFilePermissions() {
|
||||
done
|
||||
|
||||
|
||||
cd $FBRootDir
|
||||
cd $IBRootDir
|
||||
|
||||
# Fix lock files
|
||||
for i in isc_init1 isc_lock1 isc_event1
|
||||
@ -328,9 +336,24 @@ fixFilePermissions() {
|
||||
chmod ug=rw,o= interbase.log
|
||||
|
||||
chmod a=r interbase.msg
|
||||
chmod a=r README
|
||||
chmod ug=rw,o= help/help.gdb
|
||||
chmod ug=rw,o= isc4.gdb
|
||||
chmod a=r isc_config
|
||||
|
||||
# Set a default of read all files in includes
|
||||
|
||||
for i in include lib UDF intl misc
|
||||
do
|
||||
|
||||
cd $i
|
||||
for j in `ls`
|
||||
do
|
||||
chmod a=r $j
|
||||
done
|
||||
|
||||
cd ..
|
||||
done
|
||||
|
||||
# Set a default of read all files in examples
|
||||
|
||||
@ -344,28 +367,6 @@ fixFilePermissions() {
|
||||
# make examples db's writable by group
|
||||
chmod ug=rw,o= *.gdb
|
||||
|
||||
cd ..
|
||||
|
||||
|
||||
# make include files world readable
|
||||
cd include
|
||||
|
||||
for i in `ls`
|
||||
do
|
||||
chmod a=r $i
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
# make intl library world readable
|
||||
cd intl
|
||||
|
||||
for i in `ls`
|
||||
do
|
||||
chmod a=r $i
|
||||
done
|
||||
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
||||
@ -375,17 +376,22 @@ fixFilePermissions() {
|
||||
# running the server as root user. I hope to remove this mode
|
||||
# of running before the next version, since it's security level
|
||||
# is absolutely woeful.
|
||||
#
|
||||
# The main difference between fixFIlePermissionsRoot and fixFilePermissions
|
||||
# is that non root assumes you must be a member of the group to access most
|
||||
# of the files, wheras root user install gives world writable permission to
|
||||
# the installation.
|
||||
|
||||
|
||||
fixFilePermissionsRoot() {
|
||||
|
||||
# Turn other access off.
|
||||
chmod -R o= $FBRootDir
|
||||
chmod -R o= $IBRootDir
|
||||
|
||||
# Now fix up the mess.
|
||||
|
||||
# fix up directories
|
||||
for i in `find $FBRootDir -print`
|
||||
for i in `find $IBRootDir -print`
|
||||
do
|
||||
FileName=$i
|
||||
if [ -d $FileName ]
|
||||
@ -395,7 +401,7 @@ fixFilePermissionsRoot() {
|
||||
done
|
||||
|
||||
|
||||
cd $FBBin
|
||||
cd $IBBin
|
||||
|
||||
|
||||
# set up the defaults for bin
|
||||
@ -413,7 +419,21 @@ fixFilePermissionsRoot() {
|
||||
done
|
||||
|
||||
|
||||
cd $FBRootDir
|
||||
cd $IBRootDir
|
||||
|
||||
# Set a default of read all files in includes
|
||||
|
||||
for i in include lib UDF intl misc
|
||||
do
|
||||
|
||||
cd $i
|
||||
for j in `ls`
|
||||
do
|
||||
chmod a=r $j
|
||||
done
|
||||
|
||||
cd ..
|
||||
done
|
||||
|
||||
# Fix lock files
|
||||
for i in isc_init1 isc_lock1 isc_event1
|
||||
@ -426,8 +446,10 @@ fixFilePermissionsRoot() {
|
||||
chmod a=rw interbase.log
|
||||
|
||||
chmod a=r interbase.msg
|
||||
chmod a=r README
|
||||
chmod a=rw help/help.gdb
|
||||
chmod a=rw isc4.gdb
|
||||
chmod a=r isc_config
|
||||
|
||||
|
||||
# Set a default of read all files in examples
|
||||
@ -442,29 +464,37 @@ fixFilePermissionsRoot() {
|
||||
# make examples db's writable by group
|
||||
chmod a=rw *.gdb
|
||||
|
||||
cd ..
|
||||
|
||||
# make include files world readable
|
||||
cd include
|
||||
|
||||
for i in `ls`
|
||||
do
|
||||
chmod a=r $i
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
# make intl library world readable
|
||||
cd intl
|
||||
|
||||
for i in `ls`
|
||||
do
|
||||
chmod a=r $i
|
||||
done
|
||||
|
||||
cd ..
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# UpdateHostsDotEquivFile
|
||||
# The /etc/hosts.equiv file is needed to allow local access for super server
|
||||
# from processes on the machine to port 3050 on the local machine.
|
||||
# The two host names that are needed there are
|
||||
# localhost.localdomain and whatever hostname returns.
|
||||
|
||||
UpdateHostsDotEquivFile() {
|
||||
|
||||
hostEquivFile=/etc/hosts.equiv
|
||||
|
||||
if [ ! -f $hostEquivFile ]
|
||||
then
|
||||
touch $hostEquivFile
|
||||
chown root:root $hostEquivFile
|
||||
chmod u=rw,go=r $hostEquivFile
|
||||
fi
|
||||
|
||||
newLine="localhost.localdomain"
|
||||
oldLine=`grep "$newLine" $hostEquivFile`
|
||||
replaceLineInFile "$hostEquivFile" "$newLine" "$oldLine"
|
||||
|
||||
newLine="`hostname`"
|
||||
oldLine=`grep "$newLine" $hostEquivFile`
|
||||
replaceLineInFile "$hostEquivFile" "$newLine" "$oldLine"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# resetXinitdServer
|
||||
# Check for both inetd and xinetd, only one will actually be running.
|
||||
@ -479,28 +509,22 @@ resetInetdServer() {
|
||||
|
||||
if [ -f /var/run/xinetd.pid ]
|
||||
then
|
||||
kill -HUP `cat /var/run/xinetd.pid`
|
||||
kill -USR2 `cat /var/run/xinetd.pid`
|
||||
fi
|
||||
}
|
||||
|
||||
#= Main Post ===============================================================
|
||||
|
||||
# Make sure the links are in place
|
||||
if [ -z "$FirebirdInstallPrefix" ]
|
||||
then
|
||||
FirebirdInstallPrefix=@prefix@
|
||||
fi
|
||||
|
||||
# Hopefully we are done with this link.
|
||||
# if [ ! -L /opt/interbase -a ! -d /opt/interbase ]
|
||||
# then
|
||||
# # Main link and...
|
||||
# ln -s $RPM_INSTALL_PREFIX/interbase /opt/interbase
|
||||
# fi
|
||||
if [ ! -L /opt/interbase -a ! -d /opt/interbase ]
|
||||
then
|
||||
# Main link and...
|
||||
ln -s $RPM_INSTALL_PREFIX/interbase /opt/interbase
|
||||
fi
|
||||
|
||||
|
||||
FBRootDir=$FirebirdInstallPrefix
|
||||
FBBin=$FBRootDir/bin
|
||||
IBRootDir=/opt/interbase
|
||||
IBBin=$IBRootDir/bin
|
||||
RunUser=root
|
||||
# RunUser=firebird
|
||||
|
||||
@ -510,9 +534,9 @@ resetInetdServer() {
|
||||
FileName=/etc/services
|
||||
newLine="gds_db 3050/tcp # InterBase Database Remote Protocol"
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
|
||||
replaceLineInFile "$FileName" "$newLine" "$oldLine"
|
||||
|
||||
UpdateHostsDotEquivFile
|
||||
|
||||
# add Firebird user
|
||||
if [ $RunUser = "firebird" ]
|
||||
@ -522,7 +546,7 @@ resetInetdServer() {
|
||||
|
||||
|
||||
# Create Lock files
|
||||
cd $FBRootDir
|
||||
cd $IBRootDir
|
||||
|
||||
for i in isc_init1 isc_lock1 isc_event1
|
||||
do
|
||||
@ -535,13 +559,9 @@ resetInetdServer() {
|
||||
|
||||
|
||||
# Update ownership and SUID bits for programs.
|
||||
chown -R $RunUser.$RunUser $FBRootDir
|
||||
if [ "$RunUser" = "root" ]
|
||||
then
|
||||
fixFilePermissionsRoot
|
||||
else
|
||||
fixFilePermissions
|
||||
fi
|
||||
chown -R $RunUser.$RunUser $IBRootDir
|
||||
# fixFilePermissions
|
||||
fixFilePermissionsRoot
|
||||
|
||||
# Update the /etc/inetd.conf or xinetd entry
|
||||
updateInetdServiceEntry
|
||||
@ -551,9 +571,11 @@ resetInetdServer() {
|
||||
resetInetdServer
|
||||
|
||||
|
||||
cd $FBRootDir
|
||||
cd $IBRootDir
|
||||
|
||||
# Change sysdba password
|
||||
changeDBAPassword
|
||||
#changeDBAPassword
|
||||
keepOrigDBAPassword
|
||||
|
||||
|
||||
|
||||
|
@ -20,12 +20,51 @@ removeLineFromFile() {
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the xinetd config file and restart the service
|
||||
|
||||
removeXInetDService() {
|
||||
|
||||
if [ -f /etc/xinetd.d/firebird ]
|
||||
then
|
||||
rm -f /etc/xinetd.d/firebird
|
||||
fi
|
||||
|
||||
|
||||
if [ -f /var/run/xinetd.pid ]
|
||||
then
|
||||
kill -USR2 `cat /var/run/xinetd.pid`
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the inetd file and restart the service.
|
||||
|
||||
removeInetDService() {
|
||||
# Next, lose the gds_db line from /etc/inetd.conf
|
||||
|
||||
FileName=/etc/inetd.conf
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
removeLineFromFile "$FileName" "$oldLine"
|
||||
|
||||
# Get inetd to reread new inetd.conf file
|
||||
|
||||
if [ -f /var/run/inetd.pid ]
|
||||
then
|
||||
kill -HUP `cat /var/run/inetd.pid`
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#= Main PostUn ============================================================
|
||||
|
||||
if [ -L /usr/lib/libgds.so ]
|
||||
then
|
||||
rm /usr/lib/libgds.so
|
||||
fi
|
||||
# I don't think this is needed anymore.
|
||||
# if [ -L /usr/lib/libgds.so ]
|
||||
# then
|
||||
# rm /usr/lib/libgds.so
|
||||
# fi
|
||||
|
||||
if [ "$1"=0 ]
|
||||
then
|
||||
@ -36,16 +75,13 @@ removeLineFromFile() {
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
removeLineFromFile "$FileName" "$oldLine"
|
||||
|
||||
# Next, lose the gds_db line from /etc/inetd.conf
|
||||
|
||||
FileName=/etc/inetd.conf
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
removeLineFromFile "$FileName" "$oldLine"
|
||||
|
||||
# Get inetd to reread new inetd.conf file
|
||||
|
||||
if [ -f /var/run/inetd.pid ]
|
||||
|
||||
if [ -d /etc/xinetd.d ]
|
||||
then
|
||||
kill -HUP `cat /var/run/inetd.pid`
|
||||
removeXInetDService
|
||||
elif [ -f /etc/inetd.d ]
|
||||
then
|
||||
removeInetDService
|
||||
fi
|
||||
|
||||
fi
|
||||
|
@ -29,7 +29,10 @@ stopServerIfRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
if [ -f /etc/rc.d/init.d/firebird ]
|
||||
if [ -f /etc/init.d/firebird ]
|
||||
then
|
||||
/etc/init.d/firebird stop
|
||||
elif [ -f /etc/rc.d/init.d/firebird ]
|
||||
then
|
||||
/etc/rc.d/init.d/firebird stop
|
||||
fi
|
||||
@ -51,8 +54,9 @@ checkIfServerRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird super server seems to be running."
|
||||
echo "Please quit all firebird applications and then proceed"
|
||||
echo "An instance of the Firebird/InterBase Super server seems to be running."
|
||||
echo "(the ibserver or ibguard process was detected running on your system)"
|
||||
echo "Please quit all Firebird applications and then proceed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -60,20 +64,27 @@ checkIfServerRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird server seems to be running."
|
||||
echo "An instance of the Firebird/InterBase classic server seems to be running."
|
||||
echo "(the gds_inet_server or gds_pipe process was detected running on your system)"
|
||||
echo "Please quit all Firebird applications and then proceed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checkString=`netstat -an | egrep '3050.*LISTEN'`
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird server seems to be running."
|
||||
echo "Please quit all Firebird applications and then proceed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This one is commented out, since it usually works out ok, we have
|
||||
# checked that no procesers are active, but inetd/xinetd is still listening
|
||||
# the best thing would be to turn the service off, but I don't have time
|
||||
# to do all the xinetd/inetd stuff, see the preunistall.sh script for details
|
||||
#
|
||||
# checkString=`netstat -an | egrep '3050.*LISTEN'`
|
||||
#
|
||||
# if [ ! -z "$checkString" ]
|
||||
# then
|
||||
# echo "An instance of the Firebird/InterBase server seems to be running."
|
||||
# echo "(netstat -an reports a process is already listening on port 3050)"
|
||||
# echo "Please quit all Firebird applications and then proceed."
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
|
||||
# Stop lock manager if it is the only thing running.
|
||||
@ -83,7 +94,6 @@ checkIfServerRunning() {
|
||||
kill $i
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@ -135,15 +145,15 @@ archivePriorInstallSystemFiles() {
|
||||
cd /
|
||||
|
||||
|
||||
DestFile="$FBRootDir"
|
||||
DestFile="opt/interbase"
|
||||
if [ -e "$DestFile" ]
|
||||
then
|
||||
echo ""
|
||||
echo ""
|
||||
echo ""
|
||||
echo "--- Warning ----------------------------------------------"
|
||||
echo " The installation target directory: $FBRootDir"
|
||||
echo " Already contains a prior installation of Firebird."
|
||||
echo " The installation target directory: $IBRootDir"
|
||||
echo " Already contains a prior installation of InterBase/Firebird."
|
||||
echo " This and files found in /usr/include and /usr/lib will be"
|
||||
echo " archived in the file : ${ArchiveMainFile}"
|
||||
echo ""
|
||||
@ -169,7 +179,7 @@ archivePriorInstallSystemFiles() {
|
||||
fi
|
||||
done
|
||||
|
||||
for i in gds.a @FIREBIRD_LIBGDS_SO@ ib_util.so
|
||||
for i in gds_pyxis.a gds.a libgds.so.0 libgds.so libib_util.so libgds.a
|
||||
do
|
||||
DestFile=usr/lib/$i
|
||||
if [ -e $DestFile ]
|
||||
@ -178,6 +188,15 @@ archivePriorInstallSystemFiles() {
|
||||
fi
|
||||
done
|
||||
|
||||
for i in usr/sbin/rcfirebird etc/init.d/firebird etc/rc.d/init.d/firebird
|
||||
do
|
||||
DestFile=$i
|
||||
if [ -e $DestFile ]
|
||||
then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -z "$archiveFileList" ]
|
||||
then
|
||||
|
||||
@ -205,6 +224,11 @@ archivePriorInstallSystemFiles() {
|
||||
#------------------------------------------------------------------------
|
||||
# Check for installed RPM package
|
||||
|
||||
# (Pavel I've left this in since originally I could test for other packages,
|
||||
# even if they did not conflict with current ones, ie we can test InterBase
|
||||
# and CS/SS The package manager does not allow it currently but I've left
|
||||
# this in in case that sort of thing gets allowed again
|
||||
|
||||
checkForRPMInstall() {
|
||||
PackageName=$1
|
||||
|
||||
@ -224,15 +248,10 @@ checkForRPMInstall() {
|
||||
|
||||
#= Main Pre ================================================================
|
||||
|
||||
|
||||
if [ -z "$FirebirdInstallPrefix" ]
|
||||
then
|
||||
FirebirdInstallPrefix=@prefix@
|
||||
fi
|
||||
FBRootDir=$FirebirdInstallPrefix
|
||||
FBBin=$FBRootDir/bin
|
||||
IBRootDir=/opt/interbase
|
||||
IBBin=$IBRootDir/bin
|
||||
ArchiveDateTag=`date +"%Y%m%d_%H%M"`
|
||||
ArchiveMainFile="${FBRootDir}_${ArchiveDateTag}.tar.gz"
|
||||
ArchiveMainFile="${IBRootDir}_${ArchiveDateTag}.tar.gz"
|
||||
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ checkIfServerRunning() {
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird/InterBase server seems to be running."
|
||||
echo "(the gds_inet_server or gds_pipe process was detected running on your system)"
|
||||
echo "Please quit all interbase applications and then proceed."
|
||||
exit 1
|
||||
fi
|
||||
@ -35,18 +36,12 @@ checkIfServerRunning() {
|
||||
# This is a bit simple, but should work for now.
|
||||
# cron will remove files in /tmp after a while.
|
||||
|
||||
|
||||
if [ -z "$FirebirdInstallPrefix" ]
|
||||
then
|
||||
FirebirdInstallPrefix=%prefix%
|
||||
fi
|
||||
|
||||
FBRootDir=$FirebirdInstallPrefix/firebird
|
||||
FBBin=$FBRootDir/bin
|
||||
IBRootDir=/opt/interbase
|
||||
IBBin=$IBRootDir/bin
|
||||
|
||||
checkIfServerRunning
|
||||
|
||||
cd $FBRootDir
|
||||
cd $IBRootDir
|
||||
|
||||
if [ -f isc4.gdb ]
|
||||
then
|
||||
@ -54,7 +49,7 @@ checkIfServerRunning() {
|
||||
echo "Saved a copy of isc4.gdb in /tmp"
|
||||
fi
|
||||
|
||||
for i in isc_init1* isc_event1* isc_lock1* interbase.log SYSDBA.password
|
||||
for i in isc_init1* isc_event1* isc_lock1* isc_guard* interbase.log SYSDBA.password
|
||||
do
|
||||
if [ -f $i ]
|
||||
then
|
||||
|
154
src/jrd/os/posix/config_root.cpp
Normal file
154
src/jrd/os/posix/config_root.cpp
Normal file
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* PROGRAM: Client/Server Common Code
|
||||
* MODULE: config_root.cpp
|
||||
* DESCRIPTION: Configuration manager (platform specific - linux/posix)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* You may obtain a copy of the Licence at
|
||||
* http://www.gnu.org/licences/lgpl.html
|
||||
*
|
||||
* As a special exception this file can also be included in modules
|
||||
* with other source code as long as that source code has been
|
||||
* released under an Open Source Initiative certificed licence.
|
||||
* More information about OSI certification can be found at:
|
||||
* http://www.opensource.org
|
||||
*
|
||||
* This module is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public Licence for more details.
|
||||
*
|
||||
* This module was created by members of the firebird development
|
||||
* team. All individual contributions remain the Copyright (C) of
|
||||
* those individuals and all rights are reserved. Contributors to
|
||||
* this file are either listed below or can be obtained from a CVS
|
||||
* history command.
|
||||
*
|
||||
* Created by: Mark O'Donohue <skywalker@users.sourceforge.net>
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: config_root.cpp,v 1.1 2002-11-05 16:49:05 skywalker Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "fb_types.h"
|
||||
#include "fb_string.h"
|
||||
|
||||
#include "../jrd/os/config_root.h"
|
||||
#include "../jrd/os/path_utils.h"
|
||||
|
||||
typedef Firebird::string string;
|
||||
|
||||
const string CONFIG_FILE = "firebird.conf";
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Platform-specific root locator
|
||||
*/
|
||||
|
||||
#ifdef HAVE__PROC_SELF_EXE
|
||||
static string getExePathViaProcEntry()
|
||||
{
|
||||
char buffer[MAXPATHLEN];
|
||||
int len = readlink("/proc/self/exe", buffer, sizeof(buffer));
|
||||
buffer[len]=0;
|
||||
|
||||
string pathName = buffer;
|
||||
|
||||
return pathName;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
static string getRootPathFromExePath()
|
||||
{
|
||||
// get the pathname of the running executable
|
||||
string bin_dir;
|
||||
|
||||
|
||||
#ifdef HAVE__PROC_SELF_EXE
|
||||
bin_dir = getExePathViaProcEntry();
|
||||
#endif
|
||||
|
||||
// get rid of the filename
|
||||
int index = bin_dir.rfind(PathUtils::dir_sep);
|
||||
bin_dir = bin_dir.substr(0, index);
|
||||
|
||||
// how should we decide to use bin_dir instead of root_dir? any ideas?
|
||||
// ???
|
||||
|
||||
// go to the parent directory
|
||||
index = bin_dir.rfind(PathUtils::dir_sep, bin_dir.length());
|
||||
string root_dir = (index ? bin_dir.substr(0, index) : bin_dir) + PathUtils::dir_sep;
|
||||
return root_dir;
|
||||
}
|
||||
|
||||
static string getRootPathFromEnvVar()
|
||||
{
|
||||
const char* varPtr = getenv("FIREBIRD");
|
||||
|
||||
string rootpath;
|
||||
|
||||
if (varPtr == NULL) {
|
||||
rootpath = varPtr;
|
||||
}
|
||||
|
||||
return rootpath;
|
||||
}
|
||||
|
||||
|
||||
static string getRootPathFromInstallDir()
|
||||
{
|
||||
|
||||
// Need to speak to Erik about this one, as the variable
|
||||
// needs to come from the autoconf file.
|
||||
|
||||
string rootpath;
|
||||
|
||||
return rootpath;
|
||||
}
|
||||
|
||||
ConfigRoot::ConfigRoot()
|
||||
{
|
||||
|
||||
// Try getting the root path from the executable
|
||||
root_dir = getRootPathFromExePath();
|
||||
if (root_dir.length() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Try getting the root path from environment variable
|
||||
root_dir = getRootPathFromEnvVar();
|
||||
if (root_dir.length() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// As a last resort get it from the default install directory
|
||||
root_dir = ISC_PREFIX;
|
||||
}
|
||||
|
||||
string ConfigRoot::getRootDirectory() const
|
||||
{
|
||||
return root_dir;
|
||||
}
|
||||
|
||||
string ConfigRoot::getConfigFile() const
|
||||
{
|
||||
return "/etc/" + CONFIG_FILE;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#ident "$Id: config.h.in,v 1.44 2002-11-05 13:48:42 kkuznetsov Exp $"
|
||||
#ident "$Id: config.h.in,v 1.45 2002-11-05 16:49:05 skywalker Exp $"
|
||||
|
||||
/*
|
||||
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
|
||||
@ -74,6 +74,7 @@
|
||||
#undef HAVE_GETPAGESIZE
|
||||
#undef HAVE_XDR_HYPER
|
||||
|
||||
|
||||
/* Types */
|
||||
#undef socklen_t
|
||||
|
||||
@ -108,6 +109,10 @@
|
||||
/* Support databases on Raw Devices (UNIX only) */
|
||||
#undef SUPPORT_RAW_DEVICES
|
||||
|
||||
/* Support /etc/proc/exe as link to current executable
|
||||
* enables us to find path to install directory (Linux only) */
|
||||
#undef HAVE__PROC_SELF_EXE
|
||||
|
||||
/* CPU types */
|
||||
#undef PowerPC
|
||||
#undef sparc
|
||||
|
Loading…
Reference in New Issue
Block a user