diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch | 367 |
1 files changed, 367 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch b/meta/recipes-core/systemd/systemd/0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch new file mode 100644 index 0000000000..86fab9734c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch | |||
@@ -0,0 +1,367 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
3 | |||
4 | From 3f92e4b4b61042391bd44de4dceb18177df0dd57 Mon Sep 17 00:00:00 2001 | ||
5 | From: Lennart Poettering <lennart@poettering.net> | ||
6 | Date: Thu, 16 May 2013 00:19:03 +0200 | ||
7 | Subject: [PATCH] utmp: turn systemd-update-utmp-shutdown.service into a normal | ||
8 | runtime service | ||
9 | |||
10 | With this change systemd-update-utmp-shutdown.service is replaced by | ||
11 | systemd-update-utmp.service which is started at boot and stays around | ||
12 | until shutdown. This allows us to properly order the unit against both | ||
13 | /var/log and auditd. | ||
14 | |||
15 | https://bugzilla.redhat.com/show_bug.cgi?id=853104 | ||
16 | https://bugs.freedesktop.org/show_bug.cgi?id=64365 | ||
17 | --- | ||
18 | Makefile-man.am | 12 ++--- | ||
19 | Makefile.am | 8 +-- | ||
20 | man/systemd-update-utmp-runlevel.service.xml | 76 --------------------------- | ||
21 | man/systemd-update-utmp.service.xml | 76 +++++++++++++++++++++++++++ | ||
22 | src/update-utmp/update-utmp.c | 2 +- | ||
23 | units/.gitignore | 2 +- | ||
24 | units/systemd-update-utmp-runlevel.service.in | 8 +-- | ||
25 | units/systemd-update-utmp-shutdown.service.in | 19 ------- | ||
26 | units/systemd-update-utmp.service.in | 21 ++++++++ | ||
27 | 9 files changed, 114 insertions(+), 110 deletions(-) | ||
28 | delete mode 100644 man/systemd-update-utmp-runlevel.service.xml | ||
29 | create mode 100644 man/systemd-update-utmp.service.xml | ||
30 | delete mode 100644 units/systemd-update-utmp-shutdown.service.in | ||
31 | create mode 100644 units/systemd-update-utmp.service.in | ||
32 | |||
33 | diff --git a/Makefile-man.am b/Makefile-man.am | ||
34 | index 7d62094..5888158 100644 | ||
35 | --- a/Makefile-man.am | ||
36 | +++ b/Makefile-man.am | ||
37 | @@ -72,7 +72,7 @@ MANPAGES += \ | ||
38 | man/systemd-tmpfiles.8 \ | ||
39 | man/systemd-tty-ask-password-agent.1 \ | ||
40 | man/systemd-udevd.service.8 \ | ||
41 | - man/systemd-update-utmp-runlevel.service.8 \ | ||
42 | + man/systemd-update-utmp.service.8 \ | ||
43 | man/systemd.1 \ | ||
44 | man/systemd.automount.5 \ | ||
45 | man/systemd.device.5 \ | ||
46 | @@ -191,7 +191,7 @@ MANPAGES_ALIAS += \ | ||
47 | man/systemd-udevd-control.socket.8 \ | ||
48 | man/systemd-udevd-kernel.socket.8 \ | ||
49 | man/systemd-udevd.8 \ | ||
50 | - man/systemd-update-utmp-shutdown.service.8 \ | ||
51 | + man/systemd-update-utmp-runlevel.service.8 \ | ||
52 | man/systemd-update-utmp.8 \ | ||
53 | man/systemd-user.conf.5 | ||
54 | man/SD_ALERT.3: man/sd-daemon.3 | ||
55 | @@ -289,8 +289,8 @@ man/systemd-tmpfiles-setup.service.8: man/systemd-tmpfiles.8 | ||
56 | man/systemd-udevd-control.socket.8: man/systemd-udevd.service.8 | ||
57 | man/systemd-udevd-kernel.socket.8: man/systemd-udevd.service.8 | ||
58 | man/systemd-udevd.8: man/systemd-udevd.service.8 | ||
59 | -man/systemd-update-utmp-shutdown.service.8: man/systemd-update-utmp-runlevel.service.8 | ||
60 | -man/systemd-update-utmp.8: man/systemd-update-utmp-runlevel.service.8 | ||
61 | +man/systemd-update-utmp-runlevel.service.8: man/systemd-update-utmp.service.8 | ||
62 | +man/systemd-update-utmp.8: man/systemd-update-utmp.service.8 | ||
63 | man/systemd-user.conf.5: man/systemd-system.conf.5 | ||
64 | man/SD_ALERT.html: man/sd-daemon.html | ||
65 | $(html-alias) | ||
66 | @@ -577,10 +577,10 @@ man/systemd-udevd-kernel.socket.html: man/systemd-udevd.service.html | ||
67 | man/systemd-udevd.html: man/systemd-udevd.service.html | ||
68 | $(html-alias) | ||
69 | |||
70 | -man/systemd-update-utmp-shutdown.service.html: man/systemd-update-utmp-runlevel.service.html | ||
71 | +man/systemd-update-utmp-runlevel.service.html: man/systemd-update-utmp.service.html | ||
72 | $(html-alias) | ||
73 | |||
74 | -man/systemd-update-utmp.html: man/systemd-update-utmp-runlevel.service.html | ||
75 | +man/systemd-update-utmp.html: man/systemd-update-utmp.service.html | ||
76 | $(html-alias) | ||
77 | |||
78 | man/systemd-user.conf.html: man/systemd-system.conf.html | ||
79 | diff --git a/Makefile.am b/Makefile.am | ||
80 | index 8d8139c..4c5e6fc 100644 | ||
81 | --- a/Makefile.am | ||
82 | +++ b/Makefile.am | ||
83 | @@ -417,8 +417,8 @@ nodist_systemunit_DATA = \ | ||
84 | units/systemd-initctl.service \ | ||
85 | units/systemd-shutdownd.service \ | ||
86 | units/systemd-remount-fs.service \ | ||
87 | + units/systemd-update-utmp.service \ | ||
88 | units/systemd-update-utmp-runlevel.service \ | ||
89 | - units/systemd-update-utmp-shutdown.service \ | ||
90 | units/systemd-tmpfiles-setup-dev.service \ | ||
91 | units/systemd-tmpfiles-setup.service \ | ||
92 | units/systemd-tmpfiles-clean.service \ | ||
93 | @@ -463,8 +463,8 @@ EXTRA_DIST += \ | ||
94 | units/systemd-initctl.service.in \ | ||
95 | units/systemd-shutdownd.service.in \ | ||
96 | units/systemd-remount-fs.service.in \ | ||
97 | + units/systemd-update-utmp.service.in \ | ||
98 | units/systemd-update-utmp-runlevel.service.in \ | ||
99 | - units/systemd-update-utmp-shutdown.service.in \ | ||
100 | units/systemd-tmpfiles-setup-dev.service.in \ | ||
101 | units/systemd-tmpfiles-setup.service.in \ | ||
102 | units/systemd-tmpfiles-clean.service.in \ | ||
103 | @@ -4070,8 +4070,8 @@ RUNLEVEL4_TARGET_WANTS += \ | ||
104 | RUNLEVEL5_TARGET_WANTS += \ | ||
105 | systemd-update-utmp-runlevel.service | ||
106 | endif | ||
107 | -SHUTDOWN_TARGET_WANTS += \ | ||
108 | - systemd-update-utmp-shutdown.service | ||
109 | +SYSINIT_TARGET_WANTS += \ | ||
110 | + systemd-update-utmp.service | ||
111 | LOCAL_FS_TARGET_WANTS += \ | ||
112 | systemd-remount-fs.service \ | ||
113 | systemd-fsck-root.service \ | ||
114 | diff --git a/man/systemd-update-utmp-runlevel.service.xml b/man/systemd-update-utmp-runlevel.service.xml | ||
115 | deleted file mode 100644 | ||
116 | index 867b958..0000000 | ||
117 | --- a/man/systemd-update-utmp-runlevel.service.xml | ||
118 | +++ /dev/null | ||
119 | @@ -1,76 +0,0 @@ | ||
120 | -<?xml version="1.0"?> | ||
121 | -<!--*-nxml-*--> | ||
122 | -<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | ||
123 | -<!-- | ||
124 | - This file is part of systemd. | ||
125 | - | ||
126 | - Copyright 2012 Lennart Poettering | ||
127 | - | ||
128 | - systemd is free software; you can redistribute it and/or modify it | ||
129 | - under the terms of the GNU Lesser General Public License as published by | ||
130 | - the Free Software Foundation; either version 2.1 of the License, or | ||
131 | - (at your option) any later version. | ||
132 | - | ||
133 | - systemd is distributed in the hope that it will be useful, but | ||
134 | - WITHOUT ANY WARRANTY; without even the implied warranty of | ||
135 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
136 | - Lesser General Public License for more details. | ||
137 | - | ||
138 | - You should have received a copy of the GNU Lesser General Public License | ||
139 | - along with systemd; If not, see <http://www.gnu.org/licenses/>. | ||
140 | ---> | ||
141 | -<refentry id="systemd-update-utmp-runlevel.service"> | ||
142 | - | ||
143 | - <refentryinfo> | ||
144 | - <title>systemd-update-utmp-runlevel.service</title> | ||
145 | - <productname>systemd</productname> | ||
146 | - | ||
147 | - <authorgroup> | ||
148 | - <author> | ||
149 | - <contrib>Developer</contrib> | ||
150 | - <firstname>Lennart</firstname> | ||
151 | - <surname>Poettering</surname> | ||
152 | - <email>lennart@poettering.net</email> | ||
153 | - </author> | ||
154 | - </authorgroup> | ||
155 | - </refentryinfo> | ||
156 | - | ||
157 | - <refmeta> | ||
158 | - <refentrytitle>systemd-update-utmp-runlevel.service</refentrytitle> | ||
159 | - <manvolnum>8</manvolnum> | ||
160 | - </refmeta> | ||
161 | - | ||
162 | - <refnamediv> | ||
163 | - <refname>systemd-update-utmp-runlevel.service</refname> | ||
164 | - <refname>systemd-update-utmp-shutdown.service</refname> | ||
165 | - <refname>systemd-update-utmp</refname> | ||
166 | - <refpurpose>Write audit and utmp updates at runlevel | ||
167 | - changes and shutdown</refpurpose> | ||
168 | - </refnamediv> | ||
169 | - | ||
170 | - <refsynopsisdiv> | ||
171 | - <para><filename>systemd-update-utmp-runlevel.service</filename></para> | ||
172 | - <para><filename>systemd-update-utmp-shutdown.service</filename></para> | ||
173 | - <para><filename>/usr/lib/systemd/systemd-update-utmp</filename></para> | ||
174 | - </refsynopsisdiv> | ||
175 | - | ||
176 | - <refsect1> | ||
177 | - <title>Description</title> | ||
178 | - | ||
179 | - <para><filename>systemd-update-utmp-runlevel.service</filename> | ||
180 | - is a service that writes SysV runlevel changes to utmp | ||
181 | - and wtmp, as well as the audit logs, as they | ||
182 | - occur. <filename>systemd-update-utmp-shutdown.service</filename> | ||
183 | - does the same for shut-down requests.</para> | ||
184 | - </refsect1> | ||
185 | - | ||
186 | - <refsect1> | ||
187 | - <title>See Also</title> | ||
188 | - <para> | ||
189 | - <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | ||
190 | - <citerefentry><refentrytitle>utmp</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | ||
191 | - <citerefentry><refentrytitle>auditd</refentrytitle><manvolnum>8</manvolnum></citerefentry> | ||
192 | - </para> | ||
193 | - </refsect1> | ||
194 | - | ||
195 | -</refentry> | ||
196 | diff --git a/man/systemd-update-utmp.service.xml b/man/systemd-update-utmp.service.xml | ||
197 | new file mode 100644 | ||
198 | index 0000000..846fc95 | ||
199 | --- /dev/null | ||
200 | +++ b/man/systemd-update-utmp.service.xml | ||
201 | @@ -0,0 +1,76 @@ | ||
202 | +<?xml version="1.0"?> | ||
203 | +<!--*-nxml-*--> | ||
204 | +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | ||
205 | +<!-- | ||
206 | + This file is part of systemd. | ||
207 | + | ||
208 | + Copyright 2012 Lennart Poettering | ||
209 | + | ||
210 | + systemd is free software; you can redistribute it and/or modify it | ||
211 | + under the terms of the GNU Lesser General Public License as published by | ||
212 | + the Free Software Foundation; either version 2.1 of the License, or | ||
213 | + (at your option) any later version. | ||
214 | + | ||
215 | + systemd is distributed in the hope that it will be useful, but | ||
216 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
217 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
218 | + Lesser General Public License for more details. | ||
219 | + | ||
220 | + You should have received a copy of the GNU Lesser General Public License | ||
221 | + along with systemd; If not, see <http://www.gnu.org/licenses/>. | ||
222 | +--> | ||
223 | +<refentry id="systemd-update-utmp.service"> | ||
224 | + | ||
225 | + <refentryinfo> | ||
226 | + <title>systemd-update-utmp.service</title> | ||
227 | + <productname>systemd</productname> | ||
228 | + | ||
229 | + <authorgroup> | ||
230 | + <author> | ||
231 | + <contrib>Developer</contrib> | ||
232 | + <firstname>Lennart</firstname> | ||
233 | + <surname>Poettering</surname> | ||
234 | + <email>lennart@poettering.net</email> | ||
235 | + </author> | ||
236 | + </authorgroup> | ||
237 | + </refentryinfo> | ||
238 | + | ||
239 | + <refmeta> | ||
240 | + <refentrytitle>systemd-update-utmp.service</refentrytitle> | ||
241 | + <manvolnum>8</manvolnum> | ||
242 | + </refmeta> | ||
243 | + | ||
244 | + <refnamediv> | ||
245 | + <refname>systemd-update-utmp.service</refname> | ||
246 | + <refname>systemd-update-utmp-runlevel.service</refname> | ||
247 | + <refname>systemd-update-utmp</refname> | ||
248 | + <refpurpose>Write audit and utmp updates at bootup, runlevel | ||
249 | + changes and shutdown</refpurpose> | ||
250 | + </refnamediv> | ||
251 | + | ||
252 | + <refsynopsisdiv> | ||
253 | + <para><filename>systemd-update-utmp.service</filename></para> | ||
254 | + <para><filename>systemd-update-utmp-runlevel.service</filename></para> | ||
255 | + <para><filename>/usr/lib/systemd/systemd-update-utmp</filename></para> | ||
256 | + </refsynopsisdiv> | ||
257 | + | ||
258 | + <refsect1> | ||
259 | + <title>Description</title> | ||
260 | + | ||
261 | + <para><filename>systemd-update-utmp-runlevel.service</filename> | ||
262 | + is a service that writes SysV runlevel changes to utmp | ||
263 | + and wtmp, as well as the audit logs, as they | ||
264 | + occur. <filename>systemd-update-utmp.service</filename> | ||
265 | + does the same for system reboots and shut-down requests.</para> | ||
266 | + </refsect1> | ||
267 | + | ||
268 | + <refsect1> | ||
269 | + <title>See Also</title> | ||
270 | + <para> | ||
271 | + <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | ||
272 | + <citerefentry><refentrytitle>utmp</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | ||
273 | + <citerefentry><refentrytitle>auditd</refentrytitle><manvolnum>8</manvolnum></citerefentry> | ||
274 | + </para> | ||
275 | + </refsect1> | ||
276 | + | ||
277 | +</refentry> | ||
278 | diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c | ||
279 | index 9184025..202aa98 100644 | ||
280 | --- a/src/update-utmp/update-utmp.c | ||
281 | +++ b/src/update-utmp/update-utmp.c | ||
282 | @@ -104,7 +104,7 @@ static int get_current_runlevel(Context *c) { | ||
283 | { '3', SPECIAL_RUNLEVEL3_TARGET }, | ||
284 | { '4', SPECIAL_RUNLEVEL4_TARGET }, | ||
285 | { '2', SPECIAL_RUNLEVEL2_TARGET }, | ||
286 | - { 'S', SPECIAL_RESCUE_TARGET }, | ||
287 | + { '1', SPECIAL_RESCUE_TARGET }, | ||
288 | }; | ||
289 | const char | ||
290 | *interface = "org.freedesktop.systemd1.Unit", | ||
291 | diff --git a/units/systemd-update-utmp-runlevel.service.in b/units/systemd-update-utmp-runlevel.service.in | ||
292 | index 27fae2c..99783e2 100644 | ||
293 | --- a/units/systemd-update-utmp-runlevel.service.in | ||
294 | +++ b/units/systemd-update-utmp-runlevel.service.in | ||
295 | @@ -7,12 +7,14 @@ | ||
296 | |||
297 | [Unit] | ||
298 | Description=Update UTMP about System Runlevel Changes | ||
299 | -Documentation=man:systemd-update-utmp-runlevel.service(8) man:utmp(5) | ||
300 | +Documentation=man:systemd-update-utmp.service(8) man:utmp(5) | ||
301 | DefaultDependencies=no | ||
302 | RequiresMountsFor=/var/log/wtmp | ||
303 | -After=systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service | ||
304 | +Conflicts=shutdown.target | ||
305 | +Requisite=systemd-update-utmp.service | ||
306 | +After=systemd-update-utmp.service | ||
307 | After=runlevel1.target runlevel2.target runlevel3.target runlevel4.target runlevel5.target | ||
308 | -Before=final.target | ||
309 | +Before=shutdown.target | ||
310 | |||
311 | [Service] | ||
312 | Type=oneshot | ||
313 | diff --git a/units/systemd-update-utmp-shutdown.service.in b/units/systemd-update-utmp-shutdown.service.in | ||
314 | deleted file mode 100644 | ||
315 | index aa93562..0000000 | ||
316 | --- a/units/systemd-update-utmp-shutdown.service.in | ||
317 | +++ /dev/null | ||
318 | @@ -1,19 +0,0 @@ | ||
319 | -# This file is part of systemd. | ||
320 | -# | ||
321 | -# systemd is free software; you can redistribute it and/or modify it | ||
322 | -# under the terms of the GNU Lesser General Public License as published by | ||
323 | -# the Free Software Foundation; either version 2.1 of the License, or | ||
324 | -# (at your option) any later version. | ||
325 | - | ||
326 | -[Unit] | ||
327 | -Description=Update UTMP about System Shutdown | ||
328 | -Documentation=man:systemd-update-utmp-runlevel.service(8) man:utmp(5) | ||
329 | -DefaultDependencies=no | ||
330 | -RequiresMountsFor=/var/log/wtmp | ||
331 | -After=systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service | ||
332 | -After=systemd-update-utmp-runlevel.service | ||
333 | -Before=final.target | ||
334 | - | ||
335 | -[Service] | ||
336 | -Type=oneshot | ||
337 | -ExecStart=@rootlibexecdir@/systemd-update-utmp shutdown | ||
338 | diff --git a/units/systemd-update-utmp.service.in b/units/systemd-update-utmp.service.in | ||
339 | new file mode 100644 | ||
340 | index 0000000..e7c20a5 | ||
341 | --- /dev/null | ||
342 | +++ b/units/systemd-update-utmp.service.in | ||
343 | @@ -0,0 +1,21 @@ | ||
344 | +# This file is part of systemd. | ||
345 | +# | ||
346 | +# systemd is free software; you can redistribute it and/or modify it | ||
347 | +# under the terms of the GNU Lesser General Public License as published by | ||
348 | +# the Free Software Foundation; either version 2.1 of the License, or | ||
349 | +# (at your option) any later version. | ||
350 | + | ||
351 | +[Unit] | ||
352 | +Description=Update UTMP about System Reboot/Shutdown | ||
353 | +Documentation=man:systemd-update-utmp.service(8) man:utmp(5) | ||
354 | +DefaultDependencies=no | ||
355 | +RequiresMountsFor=/var/log/wtmp | ||
356 | +Conflicts=shutdown.target | ||
357 | +After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service | ||
358 | +Before=sysinit.target shutdown.target | ||
359 | + | ||
360 | +[Service] | ||
361 | +Type=oneshot | ||
362 | +RemainAfterExit=yes | ||
363 | +ExecStart=@rootlibexecdir@/systemd-update-utmp reboot | ||
364 | +ExecStop=@rootlibexecdir@/systemd-update-utmp shutdown | ||
365 | -- | ||
366 | 1.8.2.3 | ||
367 | |||