[arch-projects] [initscripts] [PATCH 17/20] rc.sysinit: Simplify /var/run/daemons workaround
Kurt J. Bosch
kjb-temp-2009 at alpenjodel.de
Sun Jul 10 12:57:05 EDT 2011
There are only two possible situations:
a) /var/run is a symlink to /run: Conditional result is always 'false' even without checking /var/run/daemons (which doesn't exist).
b) /var/run is a directory: Conditional result is always 'true' because any symlink was removed when cleaning /var/run.
So following changes can be made:
* /var/run/daemons can be removed unconditionally because a symlink doesn't survive cleaning of /var/run anyway.
* The check whether /var/run/daemons is a symlink can be dropped because it has actually no effect.
Furthermore we can refactor to use the same conditional used for cleaning /var/run because we can't create the symlink if /var/run is not a directory.
---
rc.sysinit | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit
index 4132b8c..7357582 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -227,12 +227,12 @@ RANDOM_SEED=/var/lib/misc/random-seed
cp $RANDOM_SEED /dev/urandom
stat_busy "Removing Leftover Files"
- rm -rf /etc/{nologin,shutdownpid} /forcefsck /tmp/* /tmp/.* &>/dev/null
+ rm -rf /etc/{nologin,shutdownpid} /forcefsck /tmp/* /tmp/.* /var/run/daemons &>/dev/null
[[ ! -L /var/lock ]] && rm -rf /var/lock/*
- [[ ! -L /var/run && -d /var/run ]] && find /var/run/ \! -type d -delete
- [[ ! -L /var/run && ! -L /var/run/daemons ]] &&
- rm -rf /var/run/daemons &&
+ 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
--
1.7.1
More information about the arch-projects
mailing list