12
abort-upgrade|abort-remove|abort-deconfigure)
20
if [ -r /proc/1/root ]; then
27
# Initialize rcS default file.
29
if [ ! -f /etc/default/rcS ]
31
cp -p /usr/share/initscripts/default.rcS /etc/default/rcS
33
# in Ubuntu we use /var/run and /var/lock tmpfses; transition
34
# it to the new settings in /etc/default/rcS
35
if dpkg --compare-versions "$PREV_VER" le-nl "2.86.ds1-56ubuntu1"
37
grep -wq RAMRUN /etc/default/rcS || echo 'RAMRUN=yes' >> /etc/default/rcS
38
grep -wq RAMLOCK /etc/default/rcS || echo 'RAMLOCK=yes' >> /etc/default/rcS
43
# In 2.86.ds1-7 the "single" script was moved.
44
# We have to remove the old links _before_ we install new ones.
46
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-7"
48
update-rc.d -f single remove >/dev/null 2>&1 || :
51
# In 2.86.ds1-16, the mtab.sh and hostname.sh scripts were moved.
52
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
54
update-rc.d -f mtab.sh remove >/dev/null 2>&1 || :
55
update-rc.d -f hostname.sh remove >/dev/null 2>&1 || :
58
# In 2.86.ds1-21, the sendsigs script were moved, and in 2.86.ds1-35
60
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-35"
62
update-rc.d -f sendsigs remove >/dev/null 2>&1 || :
65
# In 2.86.ds1-56ubuntu1, the waitnfs.sh was renamed to mountnfs.sh to be in
66
# sync with Debian again.
67
if dpkg --compare-versions "$PREV_VER" le-nl "2.86.ds1-56ubuntu1"
69
update-rc.d -f waitnfs.sh remove >/dev/null 2>&1 || :
73
# In 2.87dsf-2 the "mountoverflowtmp" script was dropped
74
# from runlevels 0 and 6.
75
# We have to remove the old links _before_ we install new ones.
77
if dpkg --compare-versions "$PREV_VER" lt "2.87dsf-2" ; then
78
update-rc.d -f mountoverflowtmp remove >/dev/null 2>&1 || :
81
# In 2.87dsf-4ubuntu1, the bootlogs.sh was renamed to bootlogs to be in
82
# sync with Debian again.
83
if dpkg --compare-versions "$PREV_VER" le-nl "2.87dsf-4ubuntu1"
85
update-rc.d -f bootlogs.sh remove >/dev/null 2>&1 || :
90
# Okay, we could do this with update-rc.d, but that would probably
91
# be pretty slow. This way we win some speed.
92
# DO NOT FOLLOW THIS EXAMPLE IN OTHER PACKAGES.
96
update-rc.d mountkernfs.sh start 01 S . >/dev/null || exit $?
97
update-rc.d hostname.sh start 02 S . >/dev/null || exit $?
98
update-rc.d mountdevsubfs.sh start 11 S . >/dev/null || exit $?
99
#update-rc.d bootlogd start 05 S . >/dev/null || exit $?
100
update-rc.d checkroot.sh start 20 S . >/dev/null || exit $?
101
update-rc.d mtab.sh start 22 S . >/dev/null || exit $?
102
update-rc.d checkfs.sh start 30 S . >/dev/null || exit $?
103
update-rc.d mountall.sh start 35 S . >/dev/null || exit $?
104
update-rc.d mountall-bootclean.sh start 36 S . >/dev/null || exit $?
105
update-rc.d mountoverflowtmp start 37 S . >/dev/null || exit $?
106
update-rc.d mountnfs.sh start 45 S . >/dev/null || exit $?
107
update-rc.d mountnfs-bootclean.sh start 46 S . >/dev/null || exit $?
108
update-rc.d bootmisc.sh start 55 S . >/dev/null || exit $?
109
update-rc.d urandom start 55 S . start 30 0 6 . >/dev/null || exit $?
111
# Links in runlevels other than S
113
update-rc.d halt start 90 0 . >/dev/null || exit $?
114
update-rc.d reboot start 90 6 . >/dev/null || exit $?
115
update-rc.d umountroot start 60 0 6 . >/dev/null || exit $?
116
update-rc.d umountfs start 40 0 6 . >/dev/null || exit $?
117
update-rc.d umountnfs.sh start 31 0 6 . >/dev/null || exit $?
118
update-rc.d sendsigs start 20 0 6 . >/dev/null || exit $?
120
update-rc.d killprocs start 30 1 . >/dev/null || exit $?
121
update-rc.d single start 90 1 . >/dev/null || exit $?
122
update-rc.d bootlogs start 70 1 2 3 4 5 . >/dev/null || exit $?
123
update-rc.d ondemand start 99 2 3 4 5 . >/dev/null || exit $?
124
update-rc.d rc.local start 99 2 3 4 5 . >/dev/null || exit $?
125
update-rc.d rmnologin start 99 2 3 4 5 . >/dev/null || exit $?
126
#update-rc.d stop-bootlogd-single start 99 S . >/dev/null || exit $?
127
#update-rc.d stop-bootlogd start 99 2 3 4 5 . >/dev/null || exit $?
130
# Remove scripts that were left behind by older glibc (<< 2.3.2.ds1-12)
131
# versions. We have the same functionality in mount{kern,devsub}fs.sh
134
# In 2.86.ds1-10 the "mountvirtfs" script was replaced by
135
# mountkernfs.sh and mountdevsubfs.sh. It was removed completely in
138
for F in mountkernfs devpts.sh mountvirtfs
141
update-rc.d $F remove >/dev/null 2>&1 || :
145
# Create /var/run and /var/lock on the root partition to make sure
146
# they are available when RAMRUN or RAMLOCK is enabled.
147
# If mount fail (like in a vserver environment), just clean up and ignore
148
# it. The admins enabling RAMRUN and RAMLOCK will have to create the
149
# directories themselves in this case.
151
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-22" && ! chrooted
153
# We need to quickly bind / to another location so we can make them
154
# just in case /var is a mountpoint or a symlink to one.
156
if mount -n --bind / /.root ; then
157
if [ -L /.root/var ] && [ ! -d /.root/var ] ; then
158
# No use trying if /var is a relative symlink. It is not
162
mkdir -p /.root/var/run /.root/var/lock
170
# When installing for the first time or upgrading from version before
171
# 2.86.ds1-27, a reboot is needed to make the /lib/init/rw/ tmpfs
172
# available. Flag this using notify-reboot-required. Not mounting it
173
# here as it creates problem for debootstrap, vservers, pbuilder and
176
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-27" \
177
&& [ -x /usr/share/update-notifier/notify-reboot-required ]; then
178
/usr/share/update-notifier/notify-reboot-required
182
# Create mount point for spufs, and create spu system group
184
if mountpoint -q /proc && grep -qs '^cpu.*Cell' /proc/cpuinfo; then
185
if ! getent group spu >/dev/null; then
186
# the adduser package is priority important; cannot use addgroup
187
groupadd -K GID_MAX=1000 spu
190
if ! mountpoint -q /spu; then
191
# No need to fail configuration if this isn't possible. Mount
192
# will still display an error. See LP #261490 and #251593.
193
mount -t spufs -ogid=spu spufs /spu || true
198
# Create initial log files
200
[ "$PREV_VER" ] || chmod 755 /var/log/fsck || :
201
for F in /var/log/dmesg /var/log/boot /var/log/fsck/checkroot /var/log/fsck/checkfs
203
if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1
205
echo "(Nothing has been logged yet.)" >| "$F"
212
# Set up nologin symlink so that dynamic-login-disabling will work
213
# (when DELAYLOGIN is set to "yes")
215
if [ ! -L /etc/nologin ] && [ ! -e /etc/nologin ]
217
rm -f /var/lib/initscripts/nologin
218
ln -s /var/lib/initscripts/nologin /etc/nologin
222
# Set up motd stuff, putting variable file in /var/run/
224
if [ ! -f /etc/motd.tail ]
228
sed 1d /etc/motd > /etc/motd.tail
229
[ -s /etc/motd.tail ] || rm -f /etc/motd.tail
232
if [ ! -f /var/run/motd ]
236
cat /etc/motd > /var/run/motd
241
if [ ! -L /etc/motd ]
243
[ -f /etc/default/rcS ] && . /etc/default/rcS
244
if [ "$EDITMOTD" = no ]
246
cat /var/run/motd > /etc/motd.static
247
ln -sf motd.static /etc/motd
249
ln -sf /var/run/motd /etc/motd
254
# Mount kernel virtual filesystems...not.
255
# This causes problems in pbuilder.
258
#if [ -x /etc/init.d/mountkernfs.sh ]
260
# if which invoke-rc.d >/dev/null 2>&1
262
# invoke-rc.d mountkernfs.sh start || :
264
# /etc/init.d/mountkernfs.sh start
269
# Create /dev/pts, /dev/shm directories
271
if [ "$(uname -s)" = Linux ]
274
# Only create /dev/{pts,shm} if /dev is on the
275
# root file system. If some package has mounted a
276
# seperate /dev (ramfs from udev, devfs) it is
277
# responsible for the presence of those subdirs.
278
# (it is OK for these to fail under fakechroot)
280
if ! mountpoint -q /dev
282
[ -d /dev/pts ] || { mkdir --mode=755 /dev/pts ; chown root:root /dev/pts || [ "$FAKECHROOT" = true ]; }
283
[ -d /dev/shm ] || { mkdir --mode=755 /dev/shm ; chown root:root /dev/shm || [ "$FAKECHROOT" = true ]; }
288
# Create /etc/rc.local on first time install and when upgrading from
289
# versions before "2.86.ds1-16"
291
if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
293
if [ ! -e /etc/rc.local ]; then
294
cat << EOF > /etc/rc.local
299
# This script is executed at the end of each multiuser runlevel.
300
# Make sure that the script will "exit 0" on success or any other
303
# In order to enable or disable this script just change the execution
306
# By default this script does nothing.
310
# make sure it's enabled by default.
311
chmod 755 /etc/rc.local