This file is indexed.

postinst is in open-iscsi 2.0.873-3ubuntu9.

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

set -e

update_initramfs()
{
    if [ -x /usr/sbin/update-initramfs ] && \
       [ -e /etc/initramfs-tools/initramfs.conf ] && \
       [ -e /etc/iscsi/iscsi.initramfs ]; then
        update-initramfs -u
    fi
}

case "$1" in
    configure)
	# Move old configuration from /etc/ into /etc/iscsi/
	# But only if configuration in /etc/iscsi is untouched
	
        if [ -f /etc/initiatorname.iscsi ] ; then
            if grep -q "^GenerateName=yes" /etc/iscsi/initiatorname.iscsi ; then
                mv /etc/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
		chmod 600 /etc/iscsi/initiatorname.iscsi
	    fi
	fi

    # generate a unique iSCSI InitiatorName
    NAMEFILE=/etc/iscsi/initiatorname.iscsi
    if [ ! -e $NAMEFILE ] && [ -z "$2" ] ; then
        if [ ! -x /usr/sbin/iscsi-iname ] ; then
            echo "Error: /usr/sbin/iscsi-iname does not exist, driver was not successfully installed"
            exit 1;
        fi
        # Generate a unique InitiatorName and save it
        INAME=`/usr/sbin/iscsi-iname -p iqn.1993-08.org.debian:01`
        if [ "$INAME" != "" ] ; then
            echo "## DO NOT EDIT OR REMOVE THIS FILE!" > $NAMEFILE
            echo "## If you remove this file, the iSCSI daemon will not start." >> $NAMEFILE
            echo "## If you change the InitiatorName, existing access control lists" >> $NAMEFILE
            echo "## may reject this initiator.  The InitiatorName must be unique">> $NAMEFILE
            echo "## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames." >> $NAMEFILE
            printf "InitiatorName=$INAME\n"  >> $NAMEFILE
            chmod 600 $NAMEFILE
        else
            echo "Error: failed to generate an iSCSI InitiatorName, driver cannot start."
            echo
            exit 1;
        fi
    fi
	
	if [ -d /var/lib/open-iscsi ]; then
		chmod 700   /var/lib/open-iscsi
	else
		mkdir /var/lib/open-iscsi
		chmod 700   /var/lib/open-iscsi
	fi

	update_initramfs
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# Automatically added by dh_installinit
if [ -x "/etc/init.d/open-iscsi" ]; then
	if [ ! -e "/etc/init/open-iscsi.conf" ]; then
		update-rc.d open-iscsi start 45 S . stop 81 0 1 6 . >/dev/null
	fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/umountiscsi.sh" ]; then
	if [ ! -e "/etc/init/umountiscsi.sh.conf" ]; then
		update-rc.d umountiscsi.sh stop 80 0 1 6 . >/dev/null
	fi
fi
# End automatically added section


exit 0