mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:03:04 +01:00
1. fixed some linux install scripts problems
2. added slackware support
This commit is contained in:
parent
9b62e7fb13
commit
ce8534e3c9
@ -11,6 +11,8 @@ AutoReqProv: no
|
||||
# BuildArchitectures: @CPU_TYPE@
|
||||
# BuildRoot: /var/tmp/%{name}-buildroot
|
||||
BuildRoot: @BUILD_ROOT_DIR@/gen/buildroot
|
||||
Requires: libncurses.so.5 libstdc++.so.5
|
||||
Provides: libfbclient.so.2 libfbembed.so.2 libgds.so
|
||||
|
||||
%description
|
||||
Firebird is a powerful, high-performance relational database designed to be embedded into
|
||||
|
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# /etc/rc.d/rc.firebirdss
|
||||
#
|
||||
# Start/stop/restart the firebird super server.
|
||||
#
|
||||
|
||||
export FIREBIRD=@prefix@
|
||||
FBRunUser=firebird
|
||||
pidfile=/var/run/firebird/`basename $0`.pid
|
||||
|
||||
case "$1" in
|
||||
'start') echo -n "Starting Firebird server: "
|
||||
echo $FIREBIRD/bin/fbmgr -pidfile $pidfile -start -forever | su $FBRunUser ;;
|
||||
'stop') echo -n "Stopping Firebird server: "
|
||||
if [ -f $pidfile ]; then kill `cat $pidfile`; fi ;;
|
||||
'restart') $0 stop ; $0 start ;;
|
||||
*) echo "usage $0 start|stop|restart" ;;
|
||||
esac
|
@ -101,6 +101,9 @@ getInitScriptLocation() {
|
||||
if [ -f /etc/rc.d/init.d/firebird ]
|
||||
then
|
||||
echo -n /etc/rc.d/init.d/firebird
|
||||
elif [ -f /etc/rc.d/rc.firebird ]
|
||||
then
|
||||
echo -n /etc/rc.d/rc.firebird
|
||||
elif [ -f /etc/init.d/firebird ]
|
||||
then
|
||||
echo -n /etc/init.d/firebird
|
||||
|
@ -25,6 +25,9 @@ changeInitRunUser() {
|
||||
|
||||
installInitdScript() {
|
||||
|
||||
srcScript=""
|
||||
initScript=
|
||||
|
||||
# This is for RH and MDK specific
|
||||
|
||||
if [ -e /etc/rc.d/init.d/functions ]
|
||||
@ -50,6 +53,22 @@ installInitdScript() {
|
||||
rm -f /usr/sbin/rcfirebird
|
||||
ln -s ../../etc/init.d/firebird /usr/sbin/rcfirebird
|
||||
|
||||
# Slackware specific
|
||||
|
||||
elif [ -r /etc/slackware-version ]
|
||||
then
|
||||
srcScript=firebird.init.d.slackware
|
||||
initScript=/etc/rc.d/rc.firebird
|
||||
rclocal=/etc/rc.d/rc.local
|
||||
if ! grep -q "$initScript" $rclocal
|
||||
then
|
||||
cat >>$rclocal <<EOF
|
||||
if [ -x $initScript ] ; then
|
||||
$initScript start
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Gentoo specific
|
||||
|
||||
elif [ -r /etc/gentoo-release ]
|
||||
@ -65,44 +84,60 @@ installInitdScript() {
|
||||
initScript=/etc/rc.d/init.d/firebird
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Install the firebird init.d script
|
||||
cp $FBRootDir/misc/$srcScript $initScript
|
||||
chown root:root $initScript
|
||||
chmod ug=rx,o=r $initScript
|
||||
|
||||
|
||||
# RedHat and Mandrake specific
|
||||
if [ -x /sbin/chkconfig ]
|
||||
then
|
||||
/sbin/chkconfig --add firebird
|
||||
|
||||
# Suse (& Debian ?) specific
|
||||
elif [ -x /sbin/insserv ]
|
||||
then
|
||||
/sbin/insserv /etc/init.d/firebird
|
||||
|
||||
# One more way to register service - used in Knoppix (& Debian ?)
|
||||
elif [ -x /usr/sbin/update-rc.d ]
|
||||
then
|
||||
/usr/sbin/update-rc.d firebird start 14 2 3 5 . stop 20 0 1 6 .
|
||||
fi
|
||||
if [ "$initScript" ]
|
||||
then
|
||||
# Install the firebird init.d script
|
||||
cp $FBRootDir/misc/$srcScript $initScript
|
||||
chown root:root $initScript
|
||||
chmod ug=rx,o=r $initScript
|
||||
|
||||
|
||||
# RedHat and Mandrake specific
|
||||
if [ -x /sbin/chkconfig ]
|
||||
then
|
||||
/sbin/chkconfig --add firebird
|
||||
|
||||
# Gentoo specific
|
||||
elif [ -x /sbin/rc-update ]
|
||||
then
|
||||
/sbin/rc-update add firebird default
|
||||
|
||||
# Suse (& Debian ?) specific
|
||||
elif [ -x /sbin/insserv ]
|
||||
then
|
||||
/sbin/insserv /etc/init.d/firebird
|
||||
|
||||
# More SuSE - rc.config fillup
|
||||
if [ -f /etc/rc.config ]
|
||||
then
|
||||
if [ -x /bin/fillup ]
|
||||
then
|
||||
/bin/fillup -q -d = /etc/rc.config $FBRootDir/misc/rc.config.firebird
|
||||
fi
|
||||
elif [ -d /etc/sysconfig ]
|
||||
then
|
||||
cp $FBRootDir/misc/rc.config.firebird /etc/sysconfig/firebird
|
||||
fi
|
||||
# One more way to register service - used in Knoppix (& Debian ?)
|
||||
elif [ -x /usr/sbin/update-rc.d ]
|
||||
then
|
||||
/usr/sbin/update-rc.d firebird start 14 2 3 5 . stop 20 0 1 6 .
|
||||
fi
|
||||
|
||||
# More SuSE - rc.config fillup
|
||||
if [ -f /etc/rc.config ]
|
||||
then
|
||||
if [ -x /bin/fillup ]
|
||||
then
|
||||
/bin/fillup -q -d = /etc/rc.config $FBRootDir/misc/rc.config.firebird
|
||||
fi
|
||||
elif [ -d /etc/sysconfig ]
|
||||
then
|
||||
cp $FBRootDir/misc/rc.config.firebird /etc/sysconfig/firebird
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Couldn't autodetect linux type. You must select"
|
||||
echo "the most appropriate startup script in $FBRootDir/misc/"
|
||||
echo "and manually register it in your OS."
|
||||
fi
|
||||
|
||||
# Create directory to store pidfile
|
||||
mkdir $PidDir
|
||||
if [ ! -d $PidDir ]
|
||||
then
|
||||
[ -e $PidDir ] && rm -rf $PidDir
|
||||
mkdir $PidDir
|
||||
fi
|
||||
chown $RunUser:$RunGroup $PidDir
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,11 @@ Group: Applications/Databases
|
||||
Source: Firebird-@FIREBIRD_VERSION@.@FB_BUILD_NUM@.tar.bz2
|
||||
URL: http://firebird.sourceforge.net
|
||||
# Prefix: /
|
||||
AutoReqProv: no
|
||||
AutoReqProv: no
|
||||
# BuildArchitectures: @CPU_TYPE@
|
||||
# BuildRoot: /var/tmp/%{name}-buildroot
|
||||
BuildRoot: @BUILD_ROOT_DIR@/gen/buildroot
|
||||
Requires: libncurses.so.5 libstdc++.so.5
|
||||
Provides: libfbclient.so.2 libgds.so
|
||||
|
||||
%description
|
||||
Firebird is a powerful, high-performance relational database designed to be embedded into
|
||||
|
@ -157,59 +157,6 @@ updateInetdServiceEntry() {
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# resetInetdServer
|
||||
# Works for both inetd and xinetd
|
||||
|
||||
resetInetdServer() {
|
||||
pid=`ps -efww | grep inetd | grep -v grep | awk '{print $2}'`
|
||||
if [ ! -z $pid ]
|
||||
then
|
||||
kill -HUP $pid
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the xinetd config file
|
||||
|
||||
removeXinetdEntry() {
|
||||
if [ -f /etc/xinetd.d/firebird ]
|
||||
then
|
||||
rm -f /etc/xinetd.d/firebird
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the line from inetd file
|
||||
|
||||
removeInetdEntry() {
|
||||
FileName=/etc/inetd.conf
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
removeLineFromFile "$FileName" "$oldLine"
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Remove (x)inetd service entry and restart the service.
|
||||
# Check to see if we have xinetd installed or plain inetd.
|
||||
# Install differs for each of them.
|
||||
|
||||
removeInetdServiceEntry() {
|
||||
if [ -d /etc/xinetd.d ]
|
||||
then
|
||||
removeXinetdEntry
|
||||
elif [ -f /etc/inetd.d ]
|
||||
then
|
||||
removeInetdEntry
|
||||
fi
|
||||
|
||||
# Get (x)inetd to reread configuration
|
||||
resetInetdServer
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# change init.d RunUser
|
||||
|
||||
|
@ -86,6 +86,7 @@ runSilent() {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Check for a user, running install, to be root
|
||||
|
||||
@ -94,7 +95,7 @@ checkRootUser() {
|
||||
if [ "`whoami`" != "root" ];
|
||||
then
|
||||
echo ""
|
||||
echo "--- Warning ----------------------------------------------"
|
||||
echo "--- Stop ----------------------------------------------"
|
||||
echo ""
|
||||
echo " You need to be 'root' user to do this change"
|
||||
echo ""
|
||||
@ -108,6 +109,60 @@ checkInstallUser() {
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# resetInetdServer
|
||||
# Works for both inetd and xinetd
|
||||
|
||||
resetInetdServer() {
|
||||
pid=`ps -efww | grep inetd | grep -v grep | awk '{print $2}'`
|
||||
if [ "$pid" ]
|
||||
then
|
||||
kill -HUP $pid
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the xinetd config file(s)
|
||||
# take into account possible pre-firebird xinetd services
|
||||
|
||||
removeXinetdEntry() {
|
||||
for i in `grep -l "service gds_db" /etc/xinetd.d/*`
|
||||
do
|
||||
rm -f $i
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove the line from inetd file
|
||||
|
||||
removeInetdEntry() {
|
||||
FileName=/etc/inetd.conf
|
||||
oldLine=`grep "^gds_db" $FileName`
|
||||
removeLineFromFile "$FileName" "$oldLine"
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Remove (x)inetd service entry and restart the service.
|
||||
# Check to see if we have xinetd installed or plain inetd.
|
||||
# Install differs for each of them.
|
||||
|
||||
removeInetdServiceEntry() {
|
||||
if [ -d /etc/xinetd.d ]
|
||||
then
|
||||
removeXinetdEntry
|
||||
elif [ -f /etc/inetd.conf ]
|
||||
then
|
||||
removeInetdEntry
|
||||
fi
|
||||
|
||||
# make [x]inetd reload configuration
|
||||
resetInetdServer
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# check if it is running
|
||||
|
||||
@ -122,7 +177,7 @@ checkIfServerRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird/InterBase Super server seems to be running."
|
||||
echo "An instance of the Firebird Super server seems to be running."
|
||||
echo "Please quit all interbase applications and then proceed"
|
||||
exit 1
|
||||
fi
|
||||
@ -131,7 +186,7 @@ checkIfServerRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird/InterBase server seems to be running."
|
||||
echo "An instance of the Firebird Classic server seems to be running."
|
||||
echo "Please quit all interbase applications and then proceed."
|
||||
exit 1
|
||||
fi
|
||||
@ -153,33 +208,14 @@ checkIfServerRunning() {
|
||||
|
||||
if [ ! -z "$checkString" ]
|
||||
then
|
||||
echo "An instance of the Firebird/InterBase classic 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
|
||||
|
||||
# Moved here from postinstall.sh.in. It's really easy to add appropriate
|
||||
# (x)inetd stop commands sequence here now, but taking into account,
|
||||
# that worked OK for a long time, but service port may be changed today,
|
||||
# leave it commented here. AP, 2005.
|
||||
#
|
||||
# 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
|
||||
|
||||
|
||||
removeInetdServiceEntry
|
||||
|
||||
# Stop lock manager if it is the only thing running.
|
||||
|
||||
for i in `ps -efww | grep "fb_lock_mgr" | grep -v "grep" | awk '{print $2}' `
|
||||
@ -282,6 +318,21 @@ editFile() {
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove line from config file if it exists in it.
|
||||
|
||||
removeLineFromFile() {
|
||||
FileName=$1
|
||||
oldLine=$2
|
||||
|
||||
if [ ! -z "$oldLine" ]
|
||||
then
|
||||
cat $FileName | grep -v "$oldLine" > ${FileName}.tmp
|
||||
cp ${FileName}.tmp $FileName && rm -f ${FileName}.tmp
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Write new password to the @prefix@/SYSDBA.password file
|
||||
|
||||
@ -633,22 +684,6 @@ archivePriorInstallSystemFiles() {
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# remove line from config file if it exists in it.
|
||||
|
||||
removeLineFromFile() {
|
||||
FileName=$1
|
||||
oldLine=$2
|
||||
|
||||
if [ ! -z "$oldLine" ]
|
||||
then
|
||||
cat $FileName | grep -v "$oldLine" > ${FileName}.tmp
|
||||
mv ${FileName}.tmp $FileName
|
||||
echo "Updated."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# removeInstalledFiles
|
||||
#
|
||||
|
@ -78,13 +78,3 @@ updateInetdServiceEntry() {
|
||||
# do nothing for SS
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# resetXinetdServer
|
||||
# Works for both inetd and xinetd
|
||||
|
||||
resetInetdServer() {
|
||||
# do nothing for SS
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user