| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
#------------------------------------------------------------------------ |
| 4 |
# stop server if it is running |
| 5 |
|
| 6 |
|
| 7 |
stopServerIfRunning() { |
| 8 |
checkString=`ps -ef | egrep "(fbserver|fbguard)" |grep -v grep` |
| 9 |
|
| 10 |
if [ ! -z "$checkString" ] |
| 11 |
then |
| 12 |
InitFile=/sbin/init.d/firebird |
| 13 |
if [ -x $InitFile ] |
| 14 |
then |
| 15 |
$InitFile stop |
| 16 |
fi |
| 17 |
fi |
| 18 |
|
| 19 |
checkString=`ps -ef | egrep "(fbserver|fbguard)" |grep -v grep` |
| 20 |
if [ ! -z "$checkString" ] |
| 21 |
then |
| 22 |
# careful shutdown of server failed :) |
| 23 |
# this may be for very many reasons, therefore kill it |
| 24 |
killall -9 fbguard >/dev/null 2>&1 |
| 25 |
killall -9 fbserver >/dev/null 2>&1 |
| 26 |
fi |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
#= Main PreUn ================================================================ |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
SecurityDatabase=security2.fdb |
| 37 |
|
| 38 |
|
| 39 |
stopServerIfRunning |
| 40 |
|
| 41 |
if [ -f @FB_SECDBDIR@/$SecurityDatabase ] |
| 42 |
then |
| 43 |
cp @FB_SECDBDIR@/$SecurityDatabase /tmp |
| 44 |
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp" |
| 45 |
chown root:root /tmp/$SecurityDatabase |
| 46 |
chmod 0600 /tmp/$SecurityDatabase |
| 47 |
fi |
| 48 |
|
| 49 |
|
| 50 |
for i in @FB_GUARDDIR@/fbguard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password @FB_SBINDIR@/fbmgr |
| 51 |
do |
| 52 |
if [ -f $i ] |
| 53 |
then |
| 54 |
rm -f $i |
| 55 |
fi |
| 56 |
done |
| 57 |
|
| 58 |
# testStr=`grep firebird /etc/passwd` |
| 59 |
# if [ ! -z "$testStr" ] |
| 60 |
# then |
| 61 |
# userdel firebird |
| 62 |
# fi |
| 63 |
# |
| 64 |
# testStr=`grep firebird /etc/group` |
| 65 |
# if [ ! -z "$testStr" ] |
| 66 |
# then |
| 67 |
# groupdel firebird |
| 68 |
# fi |