summaryrefslogtreecommitdiff
path: root/init.d/migrate-run.in
diff options
context:
space:
mode:
Diffstat (limited to 'init.d/migrate-run.in')
-rw-r--r--init.d/migrate-run.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/init.d/migrate-run.in b/init.d/migrate-run.in
new file mode 100644
index 0000000..544acb0
--- /dev/null
+++ b/init.d/migrate-run.in
@@ -0,0 +1,28 @@
+#!@PREFIX@/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Released under the 2-clause BSD license.
+
+description="Migrate /var/run and /var/lock to /run"
+
+depend()
+{
+ before *
+ after localmount
+}
+
+start()
+{
+ return 0
+}
+
+stop()
+{
+ 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
+ fi
+ return 0
+}