ebegin "Loading custom binary format handlers"
"$RC_LIBEXECDIR"/sh/binfmt.sh
eend $?
-return 0
+ return 0
}
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 /
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
}
depend()
{
need localmount termencoding
- after hotplug bootmisc
+ after hotplug bootmisc modules
keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
}
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
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()
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
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
rc=$?
fi
ewend $rc "Could not mount all network filesystems"
- return 0
+ if [ "$RC_UNAME" != Linux ]; then
+ rc=0
+ fi
+ return $rc
}
stop()
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"
}
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