This file is indexed.

postinst is in initscripts 2.88dsf-59.3ubuntu2.

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
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#! /bin/sh
#
# initscripts postinst
#

set -e

. /lib/init/vars.sh

# Set this as a variable to hide from lintian the fact that we're removing
# it; otherwise, a wrong lintian check + ftp fatal autoreject prevents us
# from uploading this legitimate code, even though the previous upload was
# accepted without incident.
devshm=/dev/shm

case "$1" in
  configure)
	PREV_VER=$2
	;;
  abort-upgrade|abort-remove|abort-deconfigure)
	exit 0
	;;
esac

umask 022

compat_link () {
	SRC=$1
	DEST=$2

	ssrc="$(stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
	sdest="$(stat -L --format="%d %i" "$DEST" 2>/dev/null || :)"

	if [ -n "$ssrc" ] && [ "$ssrc" != "$sdest" ]; then
		echo "guest environment detected: Linking $DEST to $SRC"
		(
			if [ -e $DEST ]; then
				if [ -L $DEST ]; then
					echo "$DEST is already a symlink; not replacing with link to $SRC"
					exit 0
				elif [ -d $DEST ]; then
					rmdir $DEST || exit 1
				else
					echo "$DEST isn't a directory or a symlink"
					exit 1
				fi
			fi
			ln -fs $SRC $DEST
		) || {
			echo "Can't symlink $DEST to $SRC; please fix manually."
			return 1
		}
		if which restorecon >/dev/null 2>&1; then
			restorecon "$DEST"
		fi
	fi

	return 0
}

# In 2.88dsf-23 the "mountoverflowtmp" script was dropped entirely.
if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-23" ; then
        update-rc.d -f mountoverflowtmp remove >/dev/null
fi
# In 2.88dsf-41+jessie1 the "mtab.sh" script was dropped entirely.
if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-41+jessie1" ; then
        update-rc.d -f mtab.sh remove >/dev/null
fi

# Comment out obsolete options in rcS.
if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-23" ; then
    if [ -f /etc/default/rcS ]; then
	sed -i \
-e 's:^\(RAMRUN=.*\)$:#\1 # OBSOLETE; see /etc/default/tmpfs and tmpfs(5).:' \
-e 's:^\(RAMLOCK=.*\)$:#\1 # OBSOLETE; see /etc/default/tmpfs and tmpfs(5).:' \
-e ':^RAMSHM=:i# OBSOLETE; see /etc/default/tmpfs and tmpfs(5).' \
-e ':^RAMTMP=:i# OBSOLETE; see /etc/default/tmpfs and tmpfs(5).' \
-e 's:^\(EDITMOTD=.*\)$:#\1 # OBSOLETE.:' /etc/default/rcS
    fi
fi

#
# Links in runlevel S
#
if [ -x /etc/init.d/mountkernfs.sh ]; then
update-rc.d mountkernfs.sh         defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/hostname.sh ]; then
update-rc.d hostname.sh            defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/mountdevsubfs.sh ]; then
update-rc.d mountdevsubfs.sh       defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/checkroot.sh ]; then
update-rc.d checkroot.sh           defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/checkroot-bootclean.sh ]; then
update-rc.d checkroot-bootclean.sh defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/checkfs.sh ]; then
update-rc.d checkfs.sh             defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/mountall.sh ]; then
update-rc.d mountall.sh            defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/mountall-bootclean.sh ]; then
update-rc.d mountall-bootclean.sh  defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/mountnfs.sh ]; then
update-rc.d mountnfs.sh            defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/mountnfs-bootclean.sh ]; then
update-rc.d mountnfs-bootclean.sh  defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/bootmisc.sh ]; then
update-rc.d bootmisc.sh            defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/urandom ]; then
update-rc.d urandom                defaults >/dev/null || exit $?
fi

#
# Links in runlevels other than S
#
if [ -x /etc/init.d/halt ]; then
update-rc.d halt                   defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/reboot ]; then
update-rc.d reboot                 defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/umountroot ]; then
update-rc.d umountroot             defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/umountfs ]; then
update-rc.d umountfs               defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/umountnfs.sh ]; then
update-rc.d umountnfs.sh           defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/sendsigs ]; then
update-rc.d sendsigs               defaults >/dev/null || exit $?
fi

if [ -x /etc/init.d/killprocs ]; then
update-rc.d killprocs              defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/single ]; then
update-rc.d single                 defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/ondemand ]; then
update-rc.d ondemand               defaults >/dev/null || exit $?
fi
if [ -x /etc/init.d/rc.local ]; then
update-rc.d rc.local               defaults >/dev/null || exit $?
fi

#
# Remove scripts that were left behind by older glibc (<< 2.3.2.ds1-12)
# versions. We have the same functionality in mount{kern,devsub}fs.sh
#
#
# In 2.86.ds1-10 the "mountvirtfs" script was replaced by
# mountkernfs.sh and mountdevsubfs.sh.  It was removed completely in
# 2.86.ds1-16.
#
for F in mountkernfs devpts.sh mountvirtfs
do
	rm -f /etc/init.d/$F
	update-rc.d $F remove >/dev/null
done

#
# When installing for the first time or upgrading from a version
# before or equal to 2.88dsf-14, a reboot is needed to make the /run
# tmpfs available.  Flag this using notify-reboot-required.  /run is
# available in some form before the reboot, so the need for a reboot
# isn't particularly urgent.
#
if dpkg --compare-versions "$PREV_VER" le "2.88dsf-13.3" \
 && [ -x /usr/share/update-notifier/notify-reboot-required ]; then
	/usr/share/update-notifier/notify-reboot-required
fi

#
# Create initial log files
#
[ "$PREV_VER" ] || chmod 755 /var/log/fsck || :
for F in /var/log/dmesg /var/log/fsck/checkroot /var/log/fsck/checkfs
do
	if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1
	then
		echo "(Nothing has been logged yet.)" >| "$F"
		chown root:adm "$F"
		chmod 640 "$F"
	fi
done

#
# Create /dev/pts, /dev/shm directories
#
if [ "$(uname -s)" = Linux ]
then
	#
	# Only create /dev/{pts,shm} if /dev is on the
	# root file system. If some package has mounted a
	# seperate /dev (ramfs from udev, devfs) it is
	# responsible for the presence of those subdirs.
	# (it is OK for these to fail under fakechroot)
	#
	if ! mountpoint -q /dev
	then
		# clean up /dev/shm -> /run/shm and /run/shm -> /dev/shm
		# circular symlinks
		if [ -L /dev/shm ] && [ "$(readlink /dev/shm)" = "/run/shm" ]; then
			if [ -L /run/shm ] && [ "$(readlink /run/shm)" = "/dev/shm" ]; then
				rm /run/shm
				mkdir --mode=1777 /run/shm
			fi
		fi
		[ -d /dev/pts ] || { mkdir --mode=755 /dev/pts ; chown root:root /dev/pts || [ "$FAKECHROOT" = true ]; }
		[ -d /dev/shm ] || { mkdir --mode=1777 /dev/shm ; chown root:root /dev/shm || [ "$FAKECHROOT" = true ]; }
	fi
fi

#
# Install runsystem.sysv on Hurd.
#
if [ "$(uname -s)" = GNU ]
then
	get_runsystem() {
	    update-alternatives --query runsystem \
		| sed -n -e '/^Value:/s|.*\.||p'
	}

	current="$(get_runsystem)"
	update-alternatives --quiet \
		--install /etc/hurd/runsystem runsystem \
		/etc/hurd/runsystem.sysv 10 \
		--slave /sbin/halt halt /sbin/halt-sysv \
		--slave /sbin/reboot reboot /sbin/reboot-sysv
	new="$(get_runsystem)"

	if [ "$current" != "$new" ]; then
	    echo "Switching from runsystem.$current to runsystem.$new."
	    echo
	fi

	echo "You can use update-alternatives --config runsystem to select"
	echo "the runsystem to use."
	echo
	echo "You must use halt-hurd or reboot-hurd to halt or reboot the"
	echo "system whenever you change the runsystem."
fi

# Ensure we have a random seed on first boot.
if [ "$PREV_VER" = "" ]; then
	if which invoke-rc.d >/dev/null 2>&1
	then
		invoke-rc.d urandom start || true
	else
		/etc/init.d/urandom start || true
	fi
fi

#
# Create /etc/rc.local on first time install and when upgrading from
# versions before "2.86.ds1-16"
#
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
then
	if [ ! -e /etc/rc.local ]; then
		cat << EOF > /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
EOF
		# make sure it's enabled by default.
		chmod 755 /etc/rc.local
	fi
fi

# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init.d/bootlogd 2.88dsf-42 initscripts -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init.d/stop-bootlogd-single 2.88dsf-42 initscripts -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init.d/stop-bootlogd 2.88dsf-42 initscripts -- "$@"
# End automatically added section


: