]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
30convertfs/convertfs.sh: fix check for /var/run and /var/lock
authorHarald Hoyer <harald@redhat.com>
Thu, 2 Feb 2012 18:18:48 +0000 (19:18 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Feb 2012 18:18:48 +0000 (19:18 +0100)
modules.d/30convertfs/convertfs.sh

index 6c76a4c46ea76a9a4d893bd3e34f08fad6e04337..eaeb8e4aaa65bfa5b7512e6148ab98e6b77ab4cb 100755 (executable)
@@ -160,13 +160,13 @@ if [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/fil
     /usr/sbin/setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
 fi
 
-if [ -d $ROOT/var/run ]; then
+if [ ! -L $ROOT/var/run ]; then
     echo "Converting /var/run to symlink"
     mv -f $ROOT/var/run $ROOT/var/run.runmove~
     ln -sfn ../run $ROOT/var/run
 fi
 
-if [ -d $ROOT/var/lock ]; then
+if [ ! -L $ROOT/var/lock ]; then
     echo "Converting /var/lock to symlink"
     mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~
     ln -sfn ../run/lock $ROOT/var/lock