summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-11-22 08:18:53 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-11-23 07:26:05 -0600
commit17a1529416441391e3b55cd22e5584b530424932 (patch)
tree9bf517401d8f47e41c0366a2dde0c3db8326fb37
parent815952a65a9cf41d3d1f353e6bee5cef4de4805a (diff)
downloadopenrc-17a1529416441391e3b55cd22e5584b530424932.tar.gz
openrc-17a1529416441391e3b55cd22e5584b530424932.tar.bz2
openrc-17a1529416441391e3b55cd22e5584b530424932.tar.xz
Migrate /var/lock and /var/run to /run for linux systems
-rw-r--r--init.d/Makefile2
-rw-r--r--init.d/migrate-run.in28
-rw-r--r--runlevels/Makefile2
3 files changed, 30 insertions, 2 deletions
diff --git a/init.d/Makefile b/init.d/Makefile
index 8351f3c..c1eb647 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -22,7 +22,7 @@ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
NET_LO-Linux= net.lo
SRCS-Linux= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \
killprocs.in modules.in mount-ro.in mtab.in numlock.in \
- procfs.in sysfs.in termencoding.in
+ procfs.in sysfs.in termencoding.in migrate-run.in
NET_LO-NetBSD= net.lo0
# Generic BSD scripts
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
+}
diff --git a/runlevels/Makefile b/runlevels/Makefile
index c1a9f09..1f599a9 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -26,7 +26,7 @@ BOOT-FreeBSD= hostid net.lo0 newsyslog savecore syslogd
# FreeBSD specific stuff
BOOT-FreeBSD+= adjkerntz dumpon syscons
-BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding
+BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding migrate-run
SHUTDOWN-Linux= killprocs mount-ro
SYSINIT-Linux= devfs dmesg