~ubuntu-branches/debian/experimental/sysvinit/experimental

« back to all changes in this revision

Viewing changes to debian/src/initscripts/etc/init.d/checkroot.sh

  • Committer: Package Import Robot
  • Author(s): Roger Leigh, Roger Leigh, Michael Stapelberg
  • Date: 2012-07-28 20:09:11 UTC
  • mfrom: (9.1.47 sid)
  • Revision ID: package-import@ubuntu.com-20120728200911-1xa3ydm5a46lyrjd
Tags: 2.88dsf-41+jessie1
[ Roger Leigh ]
* initscripts:
  - Move /etc/nologin and /var/lib/initscripts/nologin to
    /run/nologin.  This means that nologin is always created on
    a writable, available filesystem.  Closes: #660862.
  - Remove code to generate /etc/mtab.  /etc/mtab is now always a
    symbolic link to /proc/mounts.  Closes: #630723.
  - Remove incorrect use of break in case blocks in vars.sh.  Thanks
    to Raphaël Hertzog for this patch.  Closes: #701031.
  - /etc/network/if-up.d/mountnfs: Skip lo if already configured.
    Closes: #705052.  Thanks to Timo Weingärtner.
* sysvinit:
  - Document length limit of 127 in inittab process field.  Thanks
    to Johannes Truschnigg.  Closes: #693960.
* sysv-rc:
  - Fix typo in invoke-rc.d(8).  Closes: #683804.  Thanks to
    Martin-Éric Racine.

[ Michael Stapelberg ]
* systemd: update check to look for /run/systemd/system.
  Closes: #703571
* sysv-rc:
  - Add systemd support to update-rc.d(8) and invoke-rc.d(8).
    Closes: #683084.
  - service(8): use systemctl on machines that run systemd.
    Closes: #704923

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
### BEGIN INIT INFO
3
 
# Provides:          checkroot
 
3
# Provides:          checkroot mtab
4
4
# Required-Start:    mountdevsubfs hostname
5
5
# Required-Stop:     
6
6
# Should-Start:      keymap hwclockfirst hdparm bootlogd
288
288
                mtab_migrate
289
289
        fi
290
290
 
291
 
        #
292
 
        # We only create/modify /etc/mtab if the location where it is
293
 
        # stored is writable. If /etc/mtab is a symlink into /proc/
294
 
        # then it is not writable.
295
 
        #
296
 
        INIT_MTAB_FILE=no
297
 
        MTAB_PATH="$(readlink -f /etc/mtab || :)"
298
 
        case "$MTAB_PATH" in
299
 
          /proc/*)
300
 
                # Assume that /proc/ is not writable (do nothing)
301
 
                ;;
302
 
          /*)
303
 
                # Common case for file or symlink (initialise)
304
 
                if touch "$MTAB_PATH" >/dev/null 2>&1
305
 
                then
306
 
                        :> "$MTAB_PATH"
307
 
                        chmod 644 /etc/mtab
308
 
                        rm -f ${MTAB_PATH}~
309
 
                        INIT_MTAB_FILE=yes
310
 
                fi
311
 
                ;;
312
 
          "")
313
 
                [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
314
 
                if [ "$MTAB_PATH" ]
315
 
                then
316
 
                        log_failure_msg "Cannot initialize ${MTAB_PATH}."
317
 
                else
318
 
                        log_failure_msg "Cannot initialize /etc/mtab."
319
 
                fi
320
 
                ;;
321
 
          *)
322
 
                log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
323
 
                ;;
324
 
        esac
325
 
 
326
291
        if selinux_enabled && [ -x /sbin/restorecon ] && [ -r /etc/mtab ]
327
292
        then
328
293
                restorecon /etc/mtab
329
294
        fi
330
295
 
331
 
        if [ "$INIT_MTAB_FILE" = yes ]
332
 
        then
333
 
                [ "$roottype" != none ] &&
334
 
                        mount -f -o $rootopts -t $roottype $fstabroot /
335
 
        fi
336
 
 
337
296
        #
338
297
        # Remove /run/rootdev if we created it.
339
298
        #
340
299
        rm -f /run/rootdev
 
300
 
 
301
        # Update mount options for mounts created in early boot
 
302
        # S01mountkernfs.sh
 
303
        /etc/init.d/mountkernfs.sh reload
 
304
        # S03mountdevsubfs.sh
 
305
        /etc/init.d/mountdevsubfs.sh reload
 
306
 
341
307
}
342
308
 
343
309
do_status () {