1 |
commit: 17a1529416441391e3b55cd22e5584b530424932 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 22 14:18:53 2011 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 23 13:26:05 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=17a15294 |
7 |
|
8 |
Migrate /var/lock and /var/run to /run for linux systems |
9 |
|
10 |
--- |
11 |
init.d/Makefile | 2 +- |
12 |
init.d/migrate-run.in | 28 ++++++++++++++++++++++++++++ |
13 |
runlevels/Makefile | 2 +- |
14 |
3 files changed, 30 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/init.d/Makefile b/init.d/Makefile |
17 |
index 8351f3c..c1eb647 100644 |
18 |
--- a/init.d/Makefile |
19 |
+++ b/init.d/Makefile |
20 |
@@ -22,7 +22,7 @@ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \ |
21 |
NET_LO-Linux= net.lo |
22 |
SRCS-Linux= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \ |
23 |
killprocs.in modules.in mount-ro.in mtab.in numlock.in \ |
24 |
- procfs.in sysfs.in termencoding.in |
25 |
+ procfs.in sysfs.in termencoding.in migrate-run.in |
26 |
|
27 |
NET_LO-NetBSD= net.lo0 |
28 |
# Generic BSD scripts |
29 |
|
30 |
diff --git a/init.d/migrate-run.in b/init.d/migrate-run.in |
31 |
new file mode 100644 |
32 |
index 0000000..544acb0 |
33 |
--- /dev/null |
34 |
+++ b/init.d/migrate-run.in |
35 |
@@ -0,0 +1,28 @@ |
36 |
+#!@PREFIX@/sbin/runscript |
37 |
+# Copyright 1999-2011 Gentoo Foundation |
38 |
+# Released under the 2-clause BSD license. |
39 |
+ |
40 |
+description="Migrate /var/run and /var/lock to /run" |
41 |
+ |
42 |
+depend() |
43 |
+{ |
44 |
+ before * |
45 |
+ after localmount |
46 |
+} |
47 |
+ |
48 |
+start() |
49 |
+{ |
50 |
+ return 0 |
51 |
+} |
52 |
+ |
53 |
+stop() |
54 |
+{ |
55 |
+ if [ -d /run -a ! -L /var/lock -a ! -L /var/run ]; then |
56 |
+ ebegin "Migrating /var/lock and /var/run to /run" |
57 |
+ rm -rf /var/lock /var/run |
58 |
+ ln -s /var/lock /run/lock |
59 |
+ ln -s /var/run /run |
60 |
+ eend 0 |
61 |
+ fi |
62 |
+ return 0 |
63 |
+} |
64 |
|
65 |
diff --git a/runlevels/Makefile b/runlevels/Makefile |
66 |
index c1a9f09..1f599a9 100644 |
67 |
--- a/runlevels/Makefile |
68 |
+++ b/runlevels/Makefile |
69 |
@@ -26,7 +26,7 @@ BOOT-FreeBSD= hostid net.lo0 newsyslog savecore syslogd |
70 |
# FreeBSD specific stuff |
71 |
BOOT-FreeBSD+= adjkerntz dumpon syscons |
72 |
|
73 |
-BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding |
74 |
+BOOT-Linux= hwclock keymaps modules mtab net.lo procfs termencoding migrate-run |
75 |
SHUTDOWN-Linux= killprocs mount-ro |
76 |
SYSINIT-Linux= devfs dmesg |