This file is indexed.

postinst is in initscripts 2.88dsf-41ubuntu6.

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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
#! /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="$(/usr/bin/stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
	sdest="$(/usr/bin/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
		}
		[ -x /sbin/restorecon ] && /sbin/restorecon "$DEST"
	fi

	return 0
}

#
# Initialize rcS default file.
#
if [ ! -f /etc/default/rcS ]
then
	cp -p /usr/share/initscripts/default.rcS /etc/default/rcS
fi

#
# In 2.86.ds1-7 the "single" script was moved.
# We have to remove the old links _before_ we install new ones.
#
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-7"
then
	update-rc.d -f single remove >/dev/null
fi

# In 2.86.ds1-16, the mtab.sh and hostname.sh scripts were moved.
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
then
	update-rc.d -f mtab.sh remove >/dev/null
	update-rc.d -f hostname.sh remove >/dev/null
fi

# In 2.86.ds1-21, the sendsigs script were moved, and in 2.86.ds1-35
# it was moved back.
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-35"
then
	update-rc.d -f sendsigs remove >/dev/null
fi

#
# In 2.87dsf-2 the "mountoverflowtmp" script was dropped
# from runlevels 0 and 6.
# We have to remove the old links _before_ we install new ones.
#
if dpkg --compare-versions "$PREV_VER" lt "2.87dsf-2" ; then
	update-rc.d -f mountoverflowtmp remove >/dev/null
fi
# In 2.88dsf-23 the "mountoverflowtmp" script was dropped entirely.
if dpkg --compare-versions "$PREV_VER" lt "2.88dsf-23" ; then
        update-rc.d -f mountoverflowtmp remove >/dev/null
fi

# Comment out obsolete options in rcS.
if dpkg --compare-versions "$PREV_VER" lt "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

# In 2.87dsf-4ubuntu2, we begin migrating to Upstart jobs, so all of
# these get removed.
if dpkg --compare-versions "$PREV_VER" le-nl "2.87dsf-4ubuntu2"
then
	update-rc.d -f hostname.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountkernfs.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountdevsubfs.sh remove >/dev/null 2>&1 || :
	update-rc.d -f checkroot.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mtab.sh remove >/dev/null 2>&1 || :
	update-rc.d -f checkfs.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountall.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountall-bootclean.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountoverflowtmp remove >/dev/null 2>&1 || :
	update-rc.d -f mountnfs.sh remove >/dev/null 2>&1 || :
	update-rc.d -f mountnfs-bootclean.sh remove >/dev/null 2>&1 || :
	update-rc.d -f bootmisc.sh remove >/dev/null 2>&1 || :
	update-rc.d -f bootlogs remove >/dev/null 2>&1 || :
	update-rc.d -f rmnologin remove >/dev/null 2>&1 || :
fi


#
# Okay, we could do this with update-rc.d, but that would probably
# be pretty slow. This way we win some speed.
# DO NOT FOLLOW THIS EXAMPLE IN OTHER PACKAGES.
#
# Links in runlevel S
#
if [ -x /etc/init.d/urandom ]; then
update-rc.d urandom                start 55 S . start 30 0 6 . >/dev/null || exit $?
fi

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

if [ -x /etc/init.d/killprocs ]; then
update-rc.d killprocs              start 30 1 . >/dev/null || exit $?
fi
if [ -x /etc/init.d/single ]; then
update-rc.d single                 start 90 1 . >/dev/null || exit $?
fi
update-rc.d ondemand               start 99 2 3 4 5 . >/dev/null || exit $?
if [ -x /etc/init.d/rc.local ]; then
update-rc.d rc.local               start 99 2 3 4 5 . >/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

#
# Setup /run if not already in use.  Note that the intent here is to
# make the existing /var/run and /var/lock available as /run,
# /run/lock, respectively.  When the system is next restarted, a
# proper /run tmpfs will be set up.  The bind mounts set up here are
# intended to recreate the directory hierarchy using the existing
# locations in order that packages may transition to using /run
# without a system restart.
#

# If in a chroot or vserver environment (i.e. a guest, which does not
# run rcS scripts), do not do any messing around with mounts, and
# don't migrate /var/run, /var/lock or /dev/shm.  Bind mounting would
# not work in a chroot, because the migration would only be
# temporary--the rcS scripts are not guaranteed to run, so we must do
# the migration by hand at this point.  We create symlinks from the
# new locations to the old locations, which should be safe.  The
# sysadmin should, if they care, move the old locations to the new
# locations and create compatibilty symlinks at their convenience
# following the upgrade.

# chroot upgrade scenarios (from vorlon):
#
# - /dev is not bind mounted. sysvshm should be mounted *somewhere*
#   within the chroot, but we don't know where this will be done and
#   we're not going to do it ourselves. So dictate that this should be
#   /run/shm, and make /dev/shm a symlink there.
#
# - /dev is bind mounted, and /dev/shm is a symlink to /run/shm
#   (because the parent environment is also a recent Debian/Ubuntu
#   release). Make the /run/shm directory.
#
# - /dev is bind mounted, and /dev/shm is also bind mounted. This is
#   not a good situation to be in, because it means that the future
#   correctness of the chroot is dependent on the setup remaining the
#   same on the host system - which it won't if the host system is an
#   older Debian/Ubuntu release that is later upgraded. But we do the
#   best we can for now, and make /run/shm a symlink to /dev/shm.
#
# - /dev/ is bind mounted, and /dev/shm is a non-bind-mounted
#   directory. We can't fix this, so we should just create the
#   /run/shm directory and leave /dev/shm alone.
#
# State /dev  /dev/shm /run  /run/shm   Action                                          Test
# mmmm  mount mount    mount mount      WARN                                            ✓
# mmmd  mount mount    mount dir        WARN                                            ✓
# mmml  mount mount    mount link       NO ACTION; WARN if link invalid                 ✓
# mmdm  mount mount    dir†  mount      WARN                                            ✓
# mmdd  mount mount    dir†  dir        link /run to /dev/shm                           ✓
# mmdl  mount mount    dir†  link       NO ACTION; recreate link if invalid             ✓
# mdmm  mount dir      mount mount      WARN                                            ✓
# mdmd  mount dir      mount dir        WARN                                            ✓
# mdml  mount dir      mount link       NO ACTION; WARN if link invalid                 ✓
# mddm  mount dir      dir†  mount      WARN                                            ✓
# mddd  mount dir      dir†  dir        link /run to /dev/shm                           ✓
# mddl  mount dir      dir†  link       NO ACTION; recreate link if invalid             ✓
# mlmm  mount link     mount mount      NO ACTION; WARN if link invalid                 ✓
# mlmd  mount link     mount dir        NO ACTION; WARN if link invalid                 ✓
# mlml  mount link     mount link       WARN                                            ✓
# mldm  mount link     dir†  mount      NO ACTION; WARN if link invalid                 ✓
# mldd  mount link     dir†  dir        NO ACTION; WARN if link invalid                 ✓
# mldl  mount link     dir†  link       make /run a directory                           ✓
# dmmm  dir   mount    mount mount      WARN                                            ✓
# dmmd  dir   mount    mount dir        WARN                                            ✓
# dmml  dir   mount    mount link       NO ACTION; WARN if link invalid                 ✓
# dmdm  dir   mount    dir†  mount      WARN                                            ✓
# dmdd  dir   mount    dir†  dir        link /run to /dev/shm                           ✓
# dmdl  dir   mount    dir†  link       NO ACTION; recreate link if invalid             ✓
# ddmm  dir   dir      mount mount      link /dev/shm to /run                           ✓
# ddmd  dir   dir      mount dir        link /dev/shm to /run                           ✓
# ddml  dir   dir      mount link       NO ACTION; WARN if link invalid                 ✓
# dddm  dir   dir      dir†  mount      link /dev/shm to /run                           ✓
# dddd  dir   dir      dir†  dir        link /dev/shm to /run                           ✓
# dddl  dir   dir      dir†  link       NO ACTION; recreate link if invalid             ✓
# dlmm  dir   link     mount mount      NO ACTION; recreate link if invalid             ✓
# dlmd  dir   link     mount dir        NO ACTION; recreate link if invalid             ✓
# dlml  dir   link     mount link       make /dev a directory; WARN if link invalid     ✓
# dldm  dir   link     dir†  mount      NO ACTION; recreate link if invalid             ✓
# dldd  dir   link     dir†  dir        NO ACTION; recreate link if invalid             ✓
# dldl  dir   link     dir†  link       make /run a directory; recreate link if invalid ✓
# † Treat /run symlink as equivalent to dir here
# Note that link is only to /dev/shm or /run/shm; links to other
# targets will be replaced with a correct link by compat_link (where
# possible).  In some corner cases, files will be migrated from
# /dev/shm to /run/shm (or vice versa), but only when there is no
# alternative; a symlink will be made to avoid moving wherever
# possible.

if ischroot; then
	# Symlink /var/run from /run
        # Note var/run is relative
	if compat_link /var/run /run; then
		# Symlink /var/lock from /run/lock
		# Note that it's really /var/run/lock
		compat_link /var/lock /run/lock

		# Symlink /dev/shm from /run/shm
		# Note that it's really /var/run/shm
		if [ ! -e /run/shm ] && [ ! -L /run/shm ]; then
			mkdir /run/shm
		fi

		# Note trailing slash for mountpoint dir needed to
		# resolve mountpoints where the dir is a symlink.
		DEV=d
		DEVSHM=d
		RUN=d
		RUNSHM=d
		if mountpoint -q /dev/; then
		    DEV=m
		fi
		if mountpoint -q /dev/shm/; then
		    DEVSHM=m
		fi
		if [ -L /dev/shm ]; then
		    DEVSHM=l
		fi
		if mountpoint -q /run/; then
		    RUN=m
		fi
		if mountpoint -q /run/shm/; then
		    RUNSHM=m
		fi
		if [ -L /run/shm ]; then
		    RUNSHM=l
		fi

		RUNSTATE="${DEV}${DEVSHM}${RUN}${RUNSHM}"
		RUNACTION="NONE"
		case "$RUNSTATE" in
		    mmmm|mmmd|mlml|mdmm|mdmd|dmmm|dmmd|mmdm|mddm|dmdm)
			# FAIL
			echo "Due to mounts in the chroot, /dev/shm can't be safely symlinked to /run/shm.  Please correct this problem manually."
			;;
		    mlmd|mlmm|mldd|mldm)
		        # NO ACTION; FAIL if /dev/shm link invalid
			if [ "$(readlink /dev/shm)" != "/run/shm" ]; then
			    echo "Due to mounts in the chroot, /dev/shm can't be safely symlinked to /run/shm (the existing symlink is invalid).  Please correct this problem manually."
			fi
			;;
		    mmml|mdml|dmml|ddml)
			# NO ACTION; FAIL if /run/shm link invalid
			if [ "$(readlink /run/shm)" != "/dev/shm" ]; then
			    echo "Due to mounts in the chroot, /dev/shm can't be safely symlinked to /run/shm or vice versa (the existing symlink is invalid).  Please correct this problem manually."
			fi
			;;
		    dldd|dldm|dlmm|dlmd)
			# NO ACTION; recreate /dev/shm link if invalid
			if [ "$(readlink /dev/shm)" != "/run/shm" ]; then
			    echo "The existing /dev/shm symlink is invalid."
			    rm $devshm
			    RUNACTION="LINKRUN"
			fi
			;;
		    mmdl|mddl|dmdl|dddl)
			# NO ACTION; recreate /run/shm link if invalid
			if [ "$(readlink /run/shm)" != "/dev/shm" ]; then
			    echo "The existing /run/shm symlink is invalid."
			    rm /run/shm
			    RUNACTION="LINKDEV"
			fi
			;;
		    dlml)
			# check symlink is valid
			if [ "$(readlink /run/shm)" != "/dev/shm" ]; then
			    echo "Due to mounts in the chroot, /dev/shm can't be safely symlinked to /run/shm (the existing symlink is invalid).  Please correct this problem manually."
			fi
			# make /run/shm a directory
			rm $devshm
			mkdir /dev/shm
			;;
		    mldl)
			# check symlink is valid
			if [ "$(readlink /dev/shm)" != "/run/shm" ]; then
			    echo "Due to mounts in the chroot, /dev/shm can't be safely symlinked to /run/shm (the existing symlink is invalid).  Please correct this problem manually."
			fi
			# make /run/shm a directory
			rm /run/shm
			mkdir /run/shm
			;;
		    dldl)
			# check symlink is valid
			if [ "$(readlink /dev/shm)" != "/run/shm" ]; then
			    echo "The existing /dev/shm symlink is invalid."
			    rm $devshm
			    RUNACTION="LINKRUN"
			fi
			# make /run/shm a directory
			rm /run/shm
			mkdir /run/shm
			;;
		    mmdd|mddd|dmdd)
			# link /run to /dev/shm
			if [ "$(ls -A /run/shm 2> /dev/null)" != "" ]; then
			    mv /run/shm/* /dev/shm
			fi
			rm -rf /run/shm
			RUNACTION="LINKDEV"
			;;
		    ddmm|ddmd|dddm|dddd)
			# link /dev/shm to /run
			if [ "$(ls -A /dev/shm 2> /dev/null)" != "" ]; then
			    mv /dev/shm/* /run/shm
			fi
			rm -rf $devshm
			RUNACTION="LINKRUN"
			;;
		esac

		case "$RUNACTION" in
		    LINKRUN)
			compat_link /run/shm /dev/shm
			;;
		    LINKDEV)
			compat_link /dev/shm /run/shm
			;;
		esac
	fi

# Host system, not a chroot.

# non-chroot upgrade scenarios (from vorlon):
#
# - /dev/shm is bind mounted to /run/shm, with the reboot script
#   handling the fix-up to make /dev/shm a symlink to /run/shm before
#   next boot.
else
	# Deal with half-migrated setups, move /dev/shm/* to /run/shm ONLY IF
	# 1) both exist (as directories and not symlink)
	# 2) /dev/shm isn't a mountpoint
	# 3) If /run/shm is a mountpoint it can't be a bind-mount of /dev/shm
	if [ -d /run/shm ] && [ -d /dev/shm ] && [ ! -L /run/shm ] &&
	   [ ! -L /dev/shm ] && ! mountpoint -q /dev/shm &&
	   (! mountpoint -q /run/shm ||
	   [ "$(mountpoint -d /dev/shm/)" != "(mountpoint -d /run/shm/)" ]) &&
	   dpkg --compare-versions "$PREV_VER" lt 2.88dsf-13.10ubuntu12; then
		echo "Detected a case where both /dev/shm and /run/shm exist."
		echo "The content of /dev/shm will now be moved to /run/shm."
		echo "It's highly recommended to restart any software using shm."
		mv /dev/shm/* /run/shm/ >/dev/null 2>&1 || :
		rm -Rf /dev/shm
		compat_link /run/shm /dev/shm
	fi
fi

# Ensure presence of /run/sendsigs.omit.d
[ -d /run/sendsigs.omit.d ] || { mkdir --mode=755 /run/sendsigs.omit.d ; chown root:root /run/sendsigs.omit.d || [ "$FAKECHROOT" = true ]; }

# In wheezy+1, remove /lib/init/rw
#if dpkg --compare-versions "$PREV_VER" le "2.88dsf-14" \
# && [ -d /lib/init/rw ]; then
#	umount -f -r -d /lib/init/rw
#	rmdir /lib/init/rw
#fi

#
# 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 mount point for spufs, and create spu system group
#
if mountpoint -q /proc && grep -qs '^cpu.*Cell' /proc/cpuinfo; then
       if ! getent group spu >/dev/null; then
	       # the adduser package is priority important; cannot use addgroup
	       groupadd -K GID_MAX=1000 spu
       fi
       mkdir -p /spu
       if ! mountpoint -q /spu; then
	       # No need to fail configuration if this isn't possible. Mount
	       # will still display an error. See LP #261490 and #251593.
	       mount -t spufs -ogid=spu spufs /spu || true
       fi
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

#
# Set up nologin symlink so that dynamic-login-disabling will work
# (when DELAYLOGIN is set to "yes")
#
if [ ! -L /etc/nologin ] && [ ! -e /etc/nologin ]
then
	rm -f /var/lib/initscripts/nologin
	ln -s /var/lib/initscripts/nologin /etc/nologin
fi

#
# Revert motd stuff.  initscripts now lets pam_motd handle
# everything.  /etc/motd is just a regular file.
#
if dpkg --compare-versions "$PREV_VER" lt "2.88dsf-24" ; then
    if [ -L /etc/motd ] && [ "$(readlink /etc/motd)" = "/var/run/motd"  ]; then
	rm /etc/motd
	if [ -f /etc/motd.tail ]; then
	    # Move motd.tail back to motd.
	    mv /etc/motd.tail /etc/motd
	fi
    fi
    if [ ! -e /run/motd.dynamic ]; then
	rm -f /run/motd.dynamic
	if [ -e /run/motd ]; then
	    mv /run/motd /run/motd.dynamic
	else
	    echo "Generating /run/motd.dynamic; this may take a moment..."
	    run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic.new
	    mv /run/motd.dynamic.new /run/motd.dynamic
	fi
    fi
    rm -f /var/run/motd
fi

#
# Mount kernel virtual filesystems...not.
# This causes problems in pbuilder.
#
#
#if [ -x /etc/init.d/mountkernfs.sh ]
#then
#	if which invoke-rc.d >/dev/null 2>&1
#	then
#		invoke-rc.d mountkernfs.sh start || :
#	else
#		/etc/init.d/mountkernfs.sh start
#	fi
#fi

#
# 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
		[ -d /dev/pts ] || { mkdir --mode=755 /dev/pts ; chown root:root /dev/pts || [ "$FAKECHROOT" = true ]; }
		[ -d /dev/shm ] || { mkdir --mode=755 /dev/shm ; chown root:root /dev/shm || [ "$FAKECHROOT" = true ]; }
	fi
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-41ubuntu1 initscripts -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init.d/stop-bootlogd-single 2.88dsf-41ubuntu1 initscripts -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/init.d/stop-bootlogd 2.88dsf-41ubuntu1 initscripts -- "$@"
# End automatically added section


: