This file is indexed.

prerm is in firebird2.1-classic 2.1.4.18393-0.ds2-6build1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
# prerm script for firebird2.1-classic
#
# see: dh_installdeb(1)

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

set -e
. /usr/share/debconf/confmodule
set -u

FB_VER="2.1"
FB_FLAVOUR=classic
THIS="firebird$FB_VER-$FB_FLAVOUR"
. /usr/share/firebird$FB_VER-common/functions.sh

#---------------------------------------------------------------------
# stop server if it is running

checkIfClassicRunning()
{
    # Check if server is being actively used.

    LOCK_MGR_PID=`pidof $FB/bin/fb_lock_mgr || true`

    if [ -z "$LOCK_MGR_PID" ];
    then
        # lock manager not running. Safe to uninstall
        return 0
    fi

    # Check to see who is holding locks if any
    # fb_lock_mgr naturally holds a lock and should be excluded
    LOCK_PIDS=`$FB/bin/fb_lock_print | egrep "Process id:" | sed -e 's/.*Process id: *//' | sed -e 's/, UID:.*//' | grep -v "$LOCK_MGR_PID"` || true

    if [ -n "$LOCK_PIDS" ] ;
    then
        Q=shared/firebird/server_in_use
        db_subst "$Q" FB_VER $FB_VER
        db_subst "$Q" FB_FLAVOUR $FB_FLAVOUR

        if [ "${1:-}" = "loud" ]; then
            db_input critical "$Q" || true
            db_go || true
        else
            db_metaget "$Q" Description

            echo "$RET"
        fi

        exit 1
    fi

    # quit lock manager
    kill $LOCK_MGR_PID
}


case "$1" in
    remove|deconfigure|upgrade)
        checkIfClassicRunning loud
    ;;
    failed-upgrade)
        checkIfClassicRunning
    ;;
esac


# Automatically added by dh_installinit
if [ -x "/etc/init.d/firebird2.1-classic" ]; then
	invoke-rc.d firebird2.1-classic stop || exit $?
fi
# End automatically added section


exit 0