SHA256
1
0
forked from pool/systemd
systemd/avoid-random-seed-cycle.patch
Stephan Kulow 85f340d6af Accepting request 101505 from Base:System
- Update to version 39:
  + New systemd-cgtop tool to show control groups by their resource
    usage.
  + Linking against libacl for ACLs is optional again.
  + If a group "adm" exists, journal files are automatically owned
    by them, thus allow members of this group full access to the
    system journal as well as all user journals.
  + The journal now stores the SELinux context of the logging
    client for all entries.
  + Add C++ inclusion guards to all public headers.
  + New output mode "cat" in the journal to print only text
    messages, without any meta data like date or time.
  + Include tiny X server wrapper as a temporary stop-gap to teach
    XOrg udev display enumeration (until XOrg supports udev
    hotplugging for display devices).
  + Add new systemd-cat tool for executing arbitrary programs with
    STDERR/STDOUT connected to the journal. Can also act as BSD
    logger replacement, and does so by default.
  + Optionally store all locally generated coredumps in the journal
    along with meta data.
  + systemd-tmpfiles learnt four new commands: n, L, c, b, for
    writing short strings to files (for usage for /sys), and for
    creating symlinks, character and block device nodes.
  + New unit file option ControlGroupPersistent= to make cgroups
    persistent.
  + Support multiple local RTCs in a sane way.
  + No longer monopolize IO when replaying readahead data on
    rotating disks.
  + Don't show kernel threads in systemd-cgls anymore, unless
    requested with new -k switch. (forwarded request 101496 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/101505
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=85
2012-01-26 15:00:42 +00:00

110 lines
3.7 KiB
Diff

Rather than ordering systemd-random-seed-load.service after local-fs.target,
start it by path-activation.
We need write access to the seed, so we order the path unit after
remount-rootfs.service (in case /var is on the root fs).
A better solution might be to introduce PathIsWritable=, but that is not
necessary in order to solve the problem, and I don't know of any other
usecases for it.
Cc: Frederic Crozat <fcrozat@suse.com>
Cc: Michal Schmidt <mschmidt@redhat.com>
---
This is my second attempt at solving this problem. The first one had
some issues as pointed out by Frederic and Michael.
Makefile.am | 7 +++++--
TODO | 2 --
units/.gitignore | 1 +
units/systemd-random-seed-load.path.in | 18 ++++++++++++++++++
units/systemd-random-seed-load.service.in | 3 +--
5 files changed, 25 insertions(+), 6 deletions(-)
create mode 100644 units/systemd-random-seed-load.path.in
diff -urB systemd-38/Makefile.am new/Makefile.am
--- systemd-38/Makefile.am 2012-01-11 04:01:36.734404653 +0100
+++ new/Makefile.am 2012-01-18 09:53:12.763115731 +0100
@@ -1530,11 +1530,14 @@
nodist_systemunit_DATA += \
units/systemd-random-seed-save.service \
- units/systemd-random-seed-load.service
+ units/systemd-random-seed-load.service \
+ units/systemd-random-seed-load.path
+
EXTRA_DIST += \
units/systemd-random-seed-save.service.in \
- units/systemd-random-seed-load.service.in
+ units/systemd-random-seed-load.service.in \
+ units/systemd-random-seed-load.path.in
systemd_random_seed_SOURCES = \
src/random-seed.c
@@ -1550,8 +1553,8 @@
rm -f systemd-random-seed-save.service && \
$(LN_S) ../systemd-random-seed-save.service systemd-random-seed-save.service )
( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
- rm -f systemd-random-seed-load.service && \
- $(LN_S) ../systemd-random-seed-load.service systemd-random-seed-load.service )
+ rm -f systemd-random-seed-load.path && \
+ $(LN_S) ../systemd-random-seed-load.path systemd-random-seed-load.path )
INSTALL_DATA_HOOKS += \
randomseed-install-data-hook
@@ -2052,6 +2055,7 @@
-e 's,@exec_prefix\@,$(exec_prefix),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@includedir\@,$(includedir),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
< $< > $@ || rm $@
units/%: units/%.in Makefile
diff --git a/units/systemd-random-seed-load.path.in b/units/systemd-random-seed-load.path.in
new file mode 100644
index 0000000..614c1d4
--- /dev/null
+++ b/units/systemd-random-seed-load.path.in
@@ -0,0 +1,18 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Random Seed
+DefaultDependencies=no
+Conflicts=shutdown.target
+Before=basic.target shutdown.target
+# in case the seed is on the rootfs, we must
+# wait for the rootfs to be remonuted rw
+After=remount-rootfs.service
+
+[Path]
+PathExists=@localstatedir@/lib/random-seed
diff --git a/units/systemd-random-seed-load.service.in b/units/systemd-random-seed-load.service.in
index a2b6a55..2bcf1aa 100644
--- a/units/systemd-random-seed-load.service.in
+++ b/units/systemd-random-seed-load.service.in
@@ -8,9 +8,8 @@
[Unit]
Description=Load Random Seed
DefaultDependencies=no
-Wants=local-fs.target
Conflicts=shutdown.target
-After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-random-seed-load.path
Before=sysinit.target shutdown.target
[Service]
--
1.7.8