migrate-run: fix ln calls and migrate directories separately

This is based on a patch submitted by AlphatPC@gmail.com.

Reported-by: AlphatPC@gmail.com
X-Gentoo-Bug: 391945
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=391945
This commit is contained in:
William Hubbs 2011-11-27 23:29:22 -06:00
parent ab01a74405
commit b628481701

View File

@ -19,12 +19,19 @@ start()
stop() stop()
{ {
einfo "completing /var/run and /var/lock migration." einfo "completing /var/run and /var/lock migration."
if [ -d /run -a ! -L /var/lock -a ! -L /var/run ]; then if [ -d /run ]; then
ebegin "Migrating /var/lock and /var/run to /run" if [ ! -L /var/lock ]; then
rm -rf /var/lock /var/run ebegin "Migrating /var/lock to /run"
ln -s /var/lock /run/lock rm -rf /var/lock
ln -s /var/run /run ln -s /run/lock /var/lock
eend 0 eend 0
fi
if [ ! -L /var/run ]; then
ebegin "Migrating /var/run to /run"
rm -rf /var/run
ln -s /run /var/run
eend 0
fi
fi fi
return 0 return 0
} }