-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

the cleanup scripts to remove the obsolete links to
qubes-{mount-home,random-seed}.service have to problems:

1) qubes-mount-home was installed to multi-user.target and not
   sysinit.target

2) While on Fedora 24 and Debian stable 'systemctl disable' on a deleted
   service file works fine it fails in Debian unstable. Since it seems
   there is no option to change it simply use rm.

The attached patches fixes those.

HW42
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXmkKbAAoJEOSsySeKZGgWJVMP/1yYqz6ztviaVOSMYESkiQHJ
7NmT6jDuoqfrr4makQqykJ+d/m1ufO5hd0Us/hPNgc2qKJtmPrn4yOPCFDVbcOV4
fq2wR652j1gyg6XyNBOZNReH98i9mNl7ibyF4zdKzxcw/lSpbYOD86ykfiRzXxB1
DCV0QD/oNF52VC99YHtm8nYoDFZT8o2k8Np/BYRv6vC1Ji2qG0ronDyGBmKCO6VH
tD5sM0IOzrlum+g1QftpvEoYDMVm6gzJqSLZGrWSoeYmg3gB/66gKqBd+dcLhf9f
0EADfe2FYD7CZrdjdhXh0mgoT/fs7xbZyexpf2bR1wWNKOZzGnf4tD1D1tWKzDAH
GVKFl9g3sI0qbKGTXCqL4cumzjdr6VLtcfzUrHL049yLaGCsGBO+GeJUYxC/rwp1
0Jz5NeaQgVTnEyeI5iPYufNUAX61gSTB0KTKjQWy8HeRLuXOldw6C8FWJY+p+VtJ
2V5A8uDrQIUjm2HZpkOhdfOKxKVf1AQRvOWMRHU4SxyQPKnFYpNzo7eTQms2c6a1
CzGx+dsGSM8OqiV7819btcI1XHPspw7fDPv6AK2JQQ9+noW8CvLw6WpAqvTpmqU6
21Vo0szpoPVTqHmY0TilS8wF06tPUJlBbjH9BIp++I2u9tpeUg8GX8aySufCwwFT
rH2OaezkZsgwLlQZF3cO
=CpsD
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/39b050de-ae0f-9c10-3718-0b89602947e6%40ipsumj.de.
For more options, visit https://groups.google.com/d/optout.
From 23c3a38faa91110b271cb623d2ac99645400ded6 Mon Sep 17 00:00:00 2001
From: HW42 <[email protected]>
Date: Thu, 28 Jul 2016 19:08:09 +0200
Subject: [PATCH 1/2] systemd: fix qubes-mount-home path in cleanup script

---
 debian/qubes-core-agent.postinst | 2 +-
 rpm_spec/core-vm.spec            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/qubes-core-agent.postinst b/debian/qubes-core-agent.postinst
index e5d06d8..9ec5202 100755
--- a/debian/qubes-core-agent.postinst
+++ b/debian/qubes-core-agent.postinst
@@ -132,7 +132,7 @@ case "${1}" in
         if [ -L /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service ]; then
             systemctl --no-reload disable qubes-random-seed.service >/dev/null
         fi
-        if [ -L /etc/systemd/system/sysinit.target.wants/qubes-mount-home.service ]; then
+        if [ -L /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service ]; then
             systemctl --no-reload disable qubes-mount-home.service >/dev/null
         fi
 
diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec
index af8764a..dba133c 100644
--- a/rpm_spec/core-vm.spec
+++ b/rpm_spec/core-vm.spec
@@ -637,7 +637,7 @@ done
 if [ -L /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service ]; then
     systemctl --no-reload disable qubes-random-seed.service >/dev/null
 fi
-if [ -L /etc/systemd/system/sysinit.target.wants/qubes-mount-home.service ]; then
+if [ -L /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service ]; then
     systemctl --no-reload disable qubes-mount-home.service >/dev/null
 fi
 
-- 
2.8.1

From 644dfe885adf65ed256a54728b9e769dffbbbad6 Mon Sep 17 00:00:00 2001
From: HW42 <[email protected]>
Date: Thu, 28 Jul 2016 19:13:30 +0200
Subject: [PATCH 2/2] systemd: remove obsolete symlinks with rm instead of
 systemctl

The systemctl in Debian unstable fails when trying to disable a removed
service. The manpage do not mention a switch to change this behaviour.
But it says:

  Note that this operation creates only the suggested symlinks for
  the units. While this command is the recommended way to manipulate
  the unit configuration directory, the administrator is free to make
  additional changes manually by placing or removing symlinks in the
  directory.

So a simple rm should be fine.
---
 debian/qubes-core-agent.postinst | 4 ++--
 rpm_spec/core-vm.spec            | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/qubes-core-agent.postinst b/debian/qubes-core-agent.postinst
index 9ec5202..bfde8c8 100755
--- a/debian/qubes-core-agent.postinst
+++ b/debian/qubes-core-agent.postinst
@@ -130,10 +130,10 @@ case "${1}" in
 
         # remove old symlinks
         if [ -L /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service ]; then
-            systemctl --no-reload disable qubes-random-seed.service >/dev/null
+            rm /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service
         fi
         if [ -L /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service ]; then
-            systemctl --no-reload disable qubes-mount-home.service >/dev/null
+            rm /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service
         fi
 
         if ! dpkg-statoverride --list /var/lib/qubes/dom0-updates >/dev/null 2>&1; then
diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec
index dba133c..88929c0 100644
--- a/rpm_spec/core-vm.spec
+++ b/rpm_spec/core-vm.spec
@@ -635,10 +635,10 @@ done
 
 # remove old symlinks
 if [ -L /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service ]; then
-    systemctl --no-reload disable qubes-random-seed.service >/dev/null
+    rm /etc/systemd/system/sysinit.target.wants/qubes-random-seed.service
 fi
 if [ -L /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service ]; then
-    systemctl --no-reload disable qubes-mount-home.service >/dev/null
+    rm /etc/systemd/system/multi-user.target.wants/qubes-mount-home.service
 fi
 
 /bin/systemctl daemon-reload
-- 
2.8.1

Attachment: 0001-systemd-fix-qubes-mount-home-path-in-cleanup-script.patch.sig
Description: PGP signature

Attachment: 0002-systemd-remove-obsolete-symlinks-with-rm-instead-of-.patch.sig
Description: PGP signature

Reply via email to