From 65f0b26600635ea679a9a84d55c6eac0efcec3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 16 Jul 2016 23:44:57 +0200 Subject: [PATCH] systemd: plug random seed loading into systemd-random-seed Reuse its dependencies to make sure it is loaded early enough. Reported by @adrelanos Fixes QubesOS/qubes-issues#1761 --- Makefile | 1 + rpm_spec/core-vm.spec | 3 +-- vm-systemd/75-qubes-vm.preset | 1 - vm-systemd/prepare-dvm.sh | 2 +- vm-systemd/qubes-random-seed.service | 12 ------------ .../systemd-random-seed.service.d/30_qubes.conf | 5 +++++ 6 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 vm-systemd/qubes-random-seed.service create mode 100644 vm-systemd/systemd-random-seed.service.d/30_qubes.conf diff --git a/Makefile b/Makefile index 06fda31..15967d0 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ SYSTEM_DROPINS += NetworkManager.service NetworkManager-wait-online.service ntpd SYSTEM_DROPINS += tinyproxy.service SYSTEM_DROPINS += tmp.mount SYSTEM_DROPINS += org.cups.cupsd.service org.cups.cupsd.path org.cups.cupsd.socket +SYSTEM_DROPINS += systemd-random-seed.service USER_DROPINS := pulseaudio.service pulseaudio.socket diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 791fd71..3e530e1 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -552,7 +552,6 @@ The Qubes core startup configuration for SystemD init. /lib/systemd/system/qubes-update-check.timer /lib/systemd/system/qubes-updates-proxy.service /lib/systemd/system/qubes-qrexec-agent.service -/lib/systemd/system/qubes-random-seed.service /lib/systemd/system-preset/75-qubes-vm.preset /lib/modules-load.d/qubes-core.conf /lib/modules-load.d/qubes-misc.conf @@ -579,6 +578,7 @@ The Qubes core startup configuration for SystemD init. /lib/systemd/system/NetworkManager.service.d/30_qubes.conf /lib/systemd/system/NetworkManager-wait-online.service.d/30_qubes.conf /lib/systemd/system/ntpd.service.d/30_qubes.conf +/lib/systemd/system/systemd-random-seed.service.d/30_qubes.conf /lib/systemd/system/tinyproxy.service.d/30_not_needed_in_qubes_by_default.conf /lib/systemd/system/tmp.mount.d/30_qubes.conf /lib/systemd/user/pulseaudio.service.d/30_qubes.conf @@ -594,7 +594,6 @@ else services="qubes-dvm qubes-misc-post qubes-firewall qubes-mount-dirs" services="$services qubes-netwatcher qubes-network qubes-sysinit" services="$services qubes-iptables qubes-updates-proxy qubes-qrexec-agent" - services="$services qubes-random-seed" for srv in $services; do /bin/systemctl --no-reload preset $srv.service done diff --git a/vm-systemd/75-qubes-vm.preset b/vm-systemd/75-qubes-vm.preset index f46e449..05e1093 100644 --- a/vm-systemd/75-qubes-vm.preset +++ b/vm-systemd/75-qubes-vm.preset @@ -71,7 +71,6 @@ enable qubes-firewall.service enable qubes-netwatcher.service enable qubes-meminfo-writer.service enable qubes-iptables.service -enable qubes-random-seed.service enable haveged.service enable chronyd.service enable xendriverdomain.service diff --git a/vm-systemd/prepare-dvm.sh b/vm-systemd/prepare-dvm.sh index f5ffb85..36359fc 100755 --- a/vm-systemd/prepare-dvm.sh +++ b/vm-systemd/prepare-dvm.sh @@ -21,4 +21,4 @@ free | grep Mem: | echo "Waiting for save/restore..." qubesdb-read /qubes-restore-complete || wait $watch_pid echo Back to life. -systemctl restart qubes-random-seed.service +systemctl restart systemd-random-seed.service diff --git a/vm-systemd/qubes-random-seed.service b/vm-systemd/qubes-random-seed.service deleted file mode 100644 index 140f6fb..0000000 --- a/vm-systemd/qubes-random-seed.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Qubes Random Seed -DefaultDependencies=no -After=qubes-db.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/lib/qubes/init/qubes-random-seed.sh - -[Install] -WantedBy=sysinit.target diff --git a/vm-systemd/systemd-random-seed.service.d/30_qubes.conf b/vm-systemd/systemd-random-seed.service.d/30_qubes.conf new file mode 100644 index 0000000..03b3f52 --- /dev/null +++ b/vm-systemd/systemd-random-seed.service.d/30_qubes.conf @@ -0,0 +1,5 @@ +[Unit] +After=qubes-db.service + +[Service] +ExecStart=/usr/lib/qubes/init/qubes-random-seed.sh