1 |
commit: c73173ae5389e1a82aaebf2b4503ec7af32052fb |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Oct 31 15:53:37 2012 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 31 22:38:41 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c73173ae |
7 |
|
8 |
Tmpfiles: create and delete entries once in the boot runlevel. |
9 |
|
10 |
Initially, we were creating tmpfiles entries in the sysinit runlevel and |
11 |
again in the boot runlevel. Systemd runs the --create and --remove |
12 |
options in one service called systemd-tmpfiles-setup after the local |
13 |
file systems are mounted. Now we have a service called tmpfiles.setup |
14 |
which emulates this. |
15 |
|
16 |
This also closes the bug mentioned below, since we were originally |
17 |
writing to files that were on read-only file systems and that were not |
18 |
available. |
19 |
|
20 |
Reported-by: <devurandom <AT> gmx.net> |
21 |
X-Gentoo-Bug: 439012 |
22 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439012 |
23 |
|
24 |
--- |
25 |
conf.d/Makefile | 2 +- |
26 |
conf.d/{tmpfilesd => tmpfiles} | 0 |
27 |
init.d/.gitignore | 3 +-- |
28 |
init.d/Makefile | 3 +-- |
29 |
init.d/{tmpfilesd.boot.in => tmpfiles.setup.in} | 6 +++--- |
30 |
init.d/tmpfilesd.sysinit.in | 20 -------------------- |
31 |
runlevels/Makefile | 4 ++-- |
32 |
7 files changed, 8 insertions(+), 30 deletions(-) |
33 |
|
34 |
diff --git a/conf.d/Makefile b/conf.d/Makefile |
35 |
index 1f28967..24db589 100644 |
36 |
--- a/conf.d/Makefile |
37 |
+++ b/conf.d/Makefile |
38 |
@@ -1,5 +1,5 @@ |
39 |
DIR= ${CONFDIR} |
40 |
-CONF= bootmisc fsck hostname localmount netmount urandom tmpfilesd \ |
41 |
+CONF= bootmisc fsck hostname localmount netmount urandom tmpfiles \ |
42 |
${CONF-${OS}} |
43 |
|
44 |
ifeq (${MKNET},) |
45 |
|
46 |
diff --git a/conf.d/tmpfilesd b/conf.d/tmpfiles |
47 |
similarity index 100% |
48 |
rename from conf.d/tmpfilesd |
49 |
rename to conf.d/tmpfiles |
50 |
|
51 |
diff --git a/init.d/.gitignore b/init.d/.gitignore |
52 |
index 515348b..c42cd77 100644 |
53 |
--- a/init.d/.gitignore |
54 |
+++ b/init.d/.gitignore |
55 |
@@ -41,5 +41,4 @@ syslogd |
56 |
termencoding |
57 |
ttys |
58 |
wscons |
59 |
-tmpfilesd.boot |
60 |
-tmpfilesd.sysinit |
61 |
+tmpfiles.setup |
62 |
|
63 |
diff --git a/init.d/Makefile b/init.d/Makefile |
64 |
index 54e5fd5..04e09a7 100644 |
65 |
--- a/init.d/Makefile |
66 |
+++ b/init.d/Makefile |
67 |
@@ -1,8 +1,7 @@ |
68 |
DIR= ${INITDIR} |
69 |
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \ |
70 |
root.in savecache.in swap.in swapfiles.in \ |
71 |
- tmpfilesd.boot.in tmpfilesd.sysinit.in \ |
72 |
- swclock.in sysctl.in urandom.in ${SRCS-${OS}} |
73 |
+ tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}} |
74 |
BIN= ${OBJS} |
75 |
|
76 |
# Build our old net foo or not |
77 |
|
78 |
diff --git a/init.d/tmpfilesd.boot.in b/init.d/tmpfiles.setup.in |
79 |
similarity index 54% |
80 |
rename from init.d/tmpfilesd.boot.in |
81 |
rename to init.d/tmpfiles.setup.in |
82 |
index 471c128..a3ecd31 100644 |
83 |
--- a/init.d/tmpfilesd.boot.in |
84 |
+++ b/init.d/tmpfiles.setup.in |
85 |
@@ -2,7 +2,7 @@ |
86 |
# Copyright 1999-2012 Gentoo Foundation |
87 |
# Released under the 2-clause BSD license. |
88 |
|
89 |
-description="Create tmpfiles.d entries (boot)" |
90 |
+description="set up tmpfiles.d entries" |
91 |
|
92 |
depend() |
93 |
{ |
94 |
@@ -11,8 +11,8 @@ depend() |
95 |
|
96 |
start() |
97 |
{ |
98 |
- ebegin "Creating ${description#Create }" |
99 |
- @LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} |
100 |
+ ebegin "setting up tmpfiles.d entries" |
101 |
+ @LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts} |
102 |
eend $? |
103 |
return 0 |
104 |
} |
105 |
|
106 |
diff --git a/init.d/tmpfilesd.sysinit.in b/init.d/tmpfilesd.sysinit.in |
107 |
deleted file mode 100644 |
108 |
index 303a1cf..0000000 |
109 |
--- a/init.d/tmpfilesd.sysinit.in |
110 |
+++ /dev/null |
111 |
@@ -1,20 +0,0 @@ |
112 |
-#!@PREFIX@/sbin/runscript |
113 |
-# Copyright 1999-2012 Gentoo Foundation |
114 |
-# Released under the 2-clause BSD license. |
115 |
- |
116 |
-description="Create tmpfiles.d entries (sysinit)" |
117 |
- |
118 |
-depend() |
119 |
-{ |
120 |
- # Convert to 'need dev' when the new udev is ready, for OpenRC 0.11 |
121 |
- #need dev-mount |
122 |
- use dev |
123 |
-} |
124 |
- |
125 |
-start() |
126 |
-{ |
127 |
- ebegin "Creating ${description#Create }" |
128 |
- @LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} |
129 |
- eend $? |
130 |
- return 0 |
131 |
-} |
132 |
|
133 |
diff --git a/runlevels/Makefile b/runlevels/Makefile |
134 |
index a4fd006..e459d15 100644 |
135 |
--- a/runlevels/Makefile |
136 |
+++ b/runlevels/Makefile |
137 |
@@ -38,9 +38,9 @@ BOOT-FreeBSD+= hostid newsyslog savecore syslogd |
138 |
# FreeBSD specific stuff |
139 |
BOOT-FreeBSD+= adjkerntz dumpon syscons |
140 |
|
141 |
-BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding tmpfilesd.boot |
142 |
+BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding tmpfiles.setup |
143 |
SHUTDOWN-Linux= killprocs mount-ro |
144 |
-SYSINIT-Linux= devfs dmesg sysfs tmpfilesd.sysinit |
145 |
+SYSINIT-Linux= devfs dmesg sysfs |
146 |
|
147 |
# Generic BSD stuff |
148 |
BOOT-NetBSD+= hostid newsyslog savecore syslogd |