aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-11-27 23:29:22 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-11-27 23:29:22 -0600
commitb628481701d1f240ff8b2411dc041db332578a8c (patch)
tree396836c8d8596ccf05a265c1d3b96260389f454b
parentab01a74405fc316a15549aeda201521ec694981f (diff)
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
-rw-r--r--init.d/migrate-run.in19
1 files changed, 13 insertions, 6 deletions
diff --git a/init.d/migrate-run.in b/init.d/migrate-run.in
index 4eec6872..02a884df 100644
--- a/init.d/migrate-run.in
+++ b/init.d/migrate-run.in
@@ -19,12 +19,19 @@ start()
stop()
{
einfo "completing /var/run and /var/lock migration."
- if [ -d /run -a ! -L /var/lock -a ! -L /var/run ]; then
- ebegin "Migrating /var/lock and /var/run to /run"
- rm -rf /var/lock /var/run
- ln -s /var/lock /run/lock
- ln -s /var/run /run
- eend 0
+ if [ -d /run ]; then
+ if [ ! -L /var/lock ]; then
+ ebegin "Migrating /var/lock to /run"
+ rm -rf /var/lock
+ ln -s /run/lock /var/lock
+ 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
return 0
}