diff options
author | Tom Gundersen <teg@jklm.no> | 2011-04-23 20:22:23 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2011-04-23 21:44:05 +0200 |
commit | 5fcb5afeb15d0617407abfd5b0827153b632d7c4 (patch) | |
tree | 7bd0c6233826e4012206df3e38ab5be9c8650b6e /rc.sysinit | |
parent | eda191cf78365cc3d15c0b8c0d8f571c69cd059e (diff) |
remount root very early
This remounts root read-only as early as possible.
In FS#23845 we saw an example of what might happen if we boot with
root mounted rw and something manages to opens a file read-write
on root before we remount read-only.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -34,6 +34,11 @@ fi /bin/mountpoint -q /dev/shm || /bin/mount /devshm &> /dev/null \ || /bin/mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev +# remount root ro to allow for fsck later on, we remount now to +# make sure nothing can open files rw on root which would block a remount +/bin/findmnt / --options ro &>/dev/null || \ +status "Mounting Root Read-Only" /bin/mount -n -o remount,ro / + # start up our mini logger until syslog takes over /sbin/minilogd /sbin/bootlogd -p /run/bootlogd.pid @@ -216,8 +221,6 @@ if [[ -f /etc/crypttab && -n $CS ]] && /bin/grep -q ^[^#] /etc/crypttab; then fi fi -status "Mounting Root Read-only" /bin/mount -n -o remount,ro / - NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs" if [[ -x /sbin/fsck ]]; then |