]> Frank Brehm's Git Trees - config/helga/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorroot <root@helga.brehm-online.com>
Tue, 8 Dec 2015 10:52:35 +0000 (11:52 +0100)
committerroot <root@helga.brehm-online.com>
Tue, 8 Dec 2015 10:52:35 +0000 (11:52 +0100)
init.d/binfmt
init.d/bootmisc
init.d/consolefont
init.d/localmount
init.d/mtab
init.d/netmount
init.d/savecache
init.d/sysfs

index 057c76f7e9d487236bb49289729d64a0e0b11cbb..f1d8791e7fe1cd3bddcddca6dc0808d3c1bbe39b 100755 (executable)
@@ -16,5 +16,5 @@ start()
        ebegin "Loading custom binary format handlers"
        "$RC_LIBEXECDIR"/sh/binfmt.sh
        eend $?
-return 0
+       return 0
 }
index cd9f457e86c9c659775d63815a713f85c8400776..c8c0cf5464bde10fa85a84215438c0515ee8603c 100755 (executable)
@@ -121,11 +121,11 @@ clean_run()
        local dir
        # If / is still read-only due to a problem, this will fail!
        if ! checkpath -W /; then
-               eerror "/ is not writable; unable to clean up underlying /run"
+               ewarn "/ is not writable; unable to clean up underlying /run"
                return 1
        fi
        if ! checkpath -W /tmp; then
-               eerror "/tmp is not writable; unable to clean up underlying /run"
+               ewarn "/tmp is not writable; unable to clean up underlying /run"
                return 1
        fi
        # Now we know that we can modify /tmp and /
@@ -136,13 +136,12 @@ clean_run()
        dir=$(mktemp -d)
        if [ -n "$dir" -a -d $dir -a -w $dir ]; then
                mount --bind / $dir && rm -rf $dir/run/* || rc=1
-               umount $dir
-               rm -rf $dir
+               umount $dir && rmdir $dir
        else
                rc=1
        fi
        if [ $rc -ne 0 ]; then
-               eerror "Could not clean up underlying /run on /"
+               ewarn "Could not clean up underlying /run on /"
                return 1
        fi
 }
index 5b175a601c674d2c2b705b890a53c66933a9c8ff..a7ad1ddecf76432c772e86772883c140b7797e17 100755 (executable)
@@ -7,7 +7,7 @@ description="Sets a font for the consoles."
 depend()
 {
        need localmount termencoding
-       after hotplug bootmisc
+       after hotplug bootmisc modules
        keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
 }
 
index ae9d3cfebc075ca04a27828ad13ff4623aaf7be9..ed60049caa687695c457ee5ffee2d2c59570e06c 100755 (executable)
@@ -15,7 +15,7 @@ depend()
 start()
 {
        # Mount local filesystems in /etc/fstab.
-       local types="noproc" x= no_netdev=
+       local types="noproc" x= no_netdev= rc=
        for x in $net_fs_list $extra_net_fs_list; do
                types="${types},no${x}"
        done
@@ -29,9 +29,11 @@ start()
        ebegin "Mounting local filesystems"
        mount -at "$types" $no_netdev
        eend $? "Some local filesystem failed to mount"
-
-       # Always return 0 - some local mounts may not be critical for boot
-       return 0
+       rc=$?
+       if [ "$RC_UNAME" != Linux ]; then
+               rc=0
+       fi
+       return $rc
 }
 
 stop()
@@ -70,17 +72,19 @@ stop()
                        sync
                fi
 
-               local aufs_branch aufs_mount_dir aufs_mount_point aufs_si_dir aufs_si_id
-               for aufs_si_dir in /sys/fs/aufs/*; do
-                       aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
-                       aufs_si_id="$(printf "%s" $aufs_mount_dir | sed 's/_/=/g')"
+               local aufs_branch aufs_mount_point aufs_si_id aufs_br_id branches
+               for aufs_si_dir in /sys/fs/aufs/si*; do
+                       [ -d "${aufs_si_dir}" ] || continue
+                       aufs_si_id="si=${aufs_si_dir#/sys/fs/aufs/si_}"
                        aufs_mount_point="$(mountinfo -o ${aufs_si_id})"
-                       for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
+                       branches="$aufs_si_dir/br[0-9] $aufs_si_dir/br[0-9][0-9] $aufs_si_dir/br[0-9][0-9][0-9]"
+                       for x in $branches; do
+                               [ -e "${x}" ] || continue
                                aufs_branch=$(sed 's/=.*//g' $x)
                                eindent
                                if ! mount -o "remount,del:$aufs_branch" "$aufs_mount_point" > /dev/null 2>&1; then
                                        ewarn "Failed to remove branch $aufs_branch from aufs \
-                                               $aufs_mount_point"
+                                       $aufs_mount_point"
                                fi
                                eoutdent
                                sync
index 138985855e0f6d4f7cf510e164e6eda6f0d11e7d..4eaea279d88344c212a133a6d95369daa0afeff2 100755 (executable)
@@ -12,21 +12,19 @@ depend()
 
 start()
 {
-       [ -L /etc/mtab ] && return 0
        local rc=0
        ebegin "Updating /etc/mtab"
        if ! checkpath -W /etc; then
                rc=1
-       elif [ ! -e /etc/mtab ]; then
+       elif ! yesno ${mtab_is_file:-no}; then
+               [ ! -L /etc/mtab ] && [ -f /etc/mtab ] &&
+                       ewarn "Removing /etc/mtab file"
+               einfo "Creating mtab symbolic link"
                ln -snf /proc/self/mounts /etc/mtab
        else
-               ewarn "The support for updating /etc/mtab as a file is"
-               ewarn "deprecated and will be removed in the future."
-               ewarn "Please run the following command as root on your system."
-               ewarn
-               ewarn "ln -snf /proc/self/mounts /etc/mtab"
-               ewarn
-
+               [ -L /etc/mtab ] && ewarn "Removing /etc/mtab symbolic link"
+               rm -f /etc/mtab
+               einfo "Creating mtab file"
                # With / as tmpfs we cannot umount -at tmpfs in localmount as that
                # makes / readonly and dismounts all tmpfs even if in use which is
                # not good. Luckily, umount uses /etc/mtab instead of /proc/mounts
index 7949d68e57a8c842402ca6127ebc21e0ee4e9271..d8383a145eceb1635a6b69b1e76eaca611e2f470 100755 (executable)
@@ -27,7 +27,10 @@ start()
                rc=$?
        fi
        ewend $rc "Could not mount all network filesystems"
-       return 0
+       if [ "$RC_UNAME" != Linux ]; then
+               rc=0
+       fi
+       return $rc
 }
 
 stop()
index f3caa0abc96e0f02e910b00440ac18315c163b64..9e885e8ea562c4004b294eae01a2628dbb111f63 100755 (executable)
@@ -7,43 +7,53 @@ description="Saves the caches OpenRC uses to non volatile storage"
 start()
 {
        if [ -e "$RC_SVCDIR"/clock-skewed ]; then
-               ewarn "WARNING: clock skew detected!"
+               ewarn "Clock skew detected!"
                if ! yesno "${RC_GOINGDOWN}"; then
                        eerror "Not saving deptree cache"
                        return 1
                fi
        fi
-       if ! checkpath -W "$RC_LIBEXECDIR"; then
-               ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
-               if ! yesno "${RC_GOINGDOWN}"; then
-                       ewarn "Unable to save deptree cache"
+       if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
+               if ! checkpath -W "$RC_LIBEXECDIR"; then
+                       eerror "${RC_LIBEXECDIR} is not writable!"
+                       eerror "Unable to save dependency cache"
+                       if yesno "${RC_GOINGDOWN}"; then
+                               return 0
+                       fi
                        return 1
                fi
-               return 0
-       fi
-       ebegin "Saving dependency cache"
-       local rc=
-       if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
                rm -rf "$RC_LIBEXECDIR"/cache
                if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
-                       rc=$?
+                       eerror "Unable to create $RC_LIBEXECDIR/cache"
+                       eerror "Unable to save dependency cache"
                        if yesno "${RC_GOINGDOWN}"; then
-                               rc=0
+                               return 0
                        fi
-                       eend $rc "Unable to create $RC_SVCDIR/cache"
-                       return $rc
+                       return 1
+               fi
+       fi
+       if ! checkpath -W "$RC_LIBEXECDIR"/cache; then
+               eerror "${RC_LIBEXECDIR}/cache is not writable!"
+               eerror "Unable to save dependency cache"
+               if yesno "${RC_GOINGDOWN}"; then
+                       return 0
                fi
+               return 1
        fi
-       local save=
+       ebegin "Saving dependency cache"
+       local rc=0 save=
        for x in deptree depconfig shutdowntime softlevel nettree rc.log; do
                [ -e "$RC_SVCDIR/$x" ] && save="$save $RC_SVCDIR/$x"
        done
        if [ -n "$save" ]; then
-               cp -p $save "$RC_LIBEXECDIR"/cache 2>/dev/null
+               cp -p $save "$RC_LIBEXECDIR"/cache
+               rc=$?
        fi
-       rc=$?
        if yesno "${RC_GOINGDOWN}"; then
-               rc=0
+               if [ $rc -ne 0 ]; then
+                       eerror "Unable to save dependency cache"
+               fi
+               eend 0
        fi
-       eend $rc
+       eend $rc "Unable to save dependency cache"
 }
index 5dc62cd8c1ab755377c81721f8d219e79367fb4a..70eaaa9e4efe21045b8d15b46c54d67632a0b74b 100755 (executable)
@@ -116,7 +116,7 @@ mount_cgroups()
                mount -n -t cgroup \
                        -o none,${sysfs_opts},name=openrc,release_agent="$agent" \
                        openrc /sys/fs/cgroup/openrc
-               echo 1 > /sys/fs/cgroup/openrc/notify_on_release
+               printf 1 > /sys/fs/cgroup/openrc/notify_on_release
        fi
 
        yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0