From d980c23c0a5e9020402cd944c701f4e1f44d208d Mon Sep 17 00:00:00 2001 From: "Kurt J. Bosch" Date: Mon, 11 Jul 2011 22:46:15 +0200 Subject: functions/rc.sysinit: Refactor 'Removing Leftover Files' code Move it into a function to allow clean error detection of all steps performed and also to be able to reuse this in rc.single. --- functions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'functions') diff --git a/functions b/functions index 000ee0e..fdf30fd 100644 --- a/functions +++ b/functions @@ -417,6 +417,20 @@ mount_all() { mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev } +remove_leftover() { + stat_busy "Removing Leftover Files" + rm -rf /etc/{nologin,shutdownpid} /forcefsck /tmp/* /tmp/.[^.]* /tmp/..?* /var/run/daemons + [[ ! -L /var/lock ]] && rm -rf /var/lock/* + if [[ ! -L /var/run && -d /var/run ]]; then + find /var/run/ \! -type d -delete + ln -s /run/daemons /var/run/daemons + fi + install -Tm 0664 -o root -g utmp <(:) /var/run/utmp + # Keep {x,k,g}dm happy with xorg + mkdir -m 1777 /tmp/.{X11,ICE}-unix + stat_done +} + bootlogd_stop() { [[ -f /run/bootlogd.pid ]] || return 0 touch /var/log/boot -- cgit v1.2.3