2008-01-07 13:26:23 +01:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# stop server if it is running
|
|
|
|
|
|
|
|
|
|
|
|
stopServerIfRunning() {
|
|
|
|
checkString=`ps -ef | egrep "(fbserver|fbguard)" |grep -v grep`
|
|
|
|
|
|
|
|
if [ ! -z "$checkString" ]
|
|
|
|
then
|
|
|
|
InitFile=/sbin/init.d/firebird
|
|
|
|
if [ -x $InitFile ]
|
|
|
|
then
|
|
|
|
$InitFile stop
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
checkString=`ps -ef | egrep "(fbserver|fbguard)" |grep -v grep`
|
|
|
|
if [ ! -z "$checkString" ]
|
|
|
|
then
|
|
|
|
# careful shutdown of server failed :)
|
|
|
|
# this may be for very many reasons, therefore kill it
|
|
|
|
killall -9 fbguard >/dev/null 2>&1
|
|
|
|
killall -9 fbserver >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#= Main PreUn ================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-11 12:49:46 +02:00
|
|
|
SecurityDatabase=security2.fdb
|
2008-01-07 13:26:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
stopServerIfRunning
|
|
|
|
|
2009-09-11 12:49:46 +02:00
|
|
|
if [ -f @FB_SECDBDIR@/$SecurityDatabase ]
|
2008-01-07 13:26:23 +01:00
|
|
|
then
|
2009-09-11 12:49:46 +02:00
|
|
|
cp @FB_SECDBDIR@/$SecurityDatabase /tmp
|
2008-01-07 13:26:23 +01:00
|
|
|
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
|
|
|
|
chown root:root /tmp/$SecurityDatabase
|
|
|
|
chmod 0600 /tmp/$SecurityDatabase
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2009-09-11 12:49:46 +02:00
|
|
|
for i in @FB_GUARDDIR@/fbguard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password @FB_SBINDIR@/fbmgr
|
2008-01-07 13:26:23 +01:00
|
|
|
do
|
|
|
|
if [ -f $i ]
|
|
|
|
then
|
|
|
|
rm -f $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# testStr=`grep firebird /etc/passwd`
|
|
|
|
# if [ ! -z "$testStr" ]
|
|
|
|
# then
|
|
|
|
# userdel firebird
|
|
|
|
# fi
|
|
|
|
#
|
|
|
|
# testStr=`grep firebird /etc/group`
|
|
|
|
# if [ ! -z "$testStr" ]
|
|
|
|
# then
|
|
|
|
# groupdel firebird
|
|
|
|
# fi
|