aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-07 01:23:45 +0200
committerTom Gundersen <teg@jklm.no>2011-07-10 21:54:37 +0200
commit71e8540921bba7df926a3af9714d380c5af2b538 (patch)
tree96e566a234f2ea66644aea8a850b0b820a62cdcb /rc.sysinit
parent98363ca955850c62064934265c56a7ca159b0035 (diff)
downloadinitscripts-71e8540921bba7df926a3af9714d380c5af2b538.tar.xz
rc.sysinit: Simplify /var/run/daemons workaround
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.
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit8
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