From fc04408c7a3c7a28c7f0d4ed4dc24e8bc3b4dc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 30 Jan 2014 02:53:08 +0100 Subject: [PATCH] systemd: disable ModemManager in non-NetVM Previously ModemManager was started by NetworkManager, but in fc20+ it is a separate service, so disable it when not needed. --- Makefile | 1 + rpm_spec/core-vm.spec | 6 +++++- vm-systemd/ModemManager.service | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 vm-systemd/ModemManager.service diff --git a/Makefile b/Makefile index 3173e21..bf1a824 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ install-vm: install -m 0755 vm-systemd/*.sh $(DESTDIR)/usr/lib/qubes/init/ install -m 0644 vm-systemd/qubes-*.service $(DESTDIR)/lib/systemd/system/ install -m 0644 vm-systemd/qubes-*.timer $(DESTDIR)/lib/systemd/system/ + install -m 0644 vm-systemd/ModemManager.service $(DESTDIR)/usr/lib/qubes/init/ install -m 0644 vm-systemd/NetworkManager.service $(DESTDIR)/usr/lib/qubes/init/ install -m 0644 vm-systemd/NetworkManager-wait-online.service $(DESTDIR)/usr/lib/qubes/init/ install -m 0644 vm-systemd/cups.* $(DESTDIR)/usr/lib/qubes/init/ diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 835f656..fe79628 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -448,6 +448,7 @@ The Qubes core startup configuration for SystemD init. /usr/lib/qubes/init/misc-post.sh /usr/lib/qubes/init/misc-post-stop.sh /usr/lib/qubes/init/qubes-sysinit.sh +/usr/lib/qubes/init/ModemManager.service /usr/lib/qubes/init/NetworkManager.service /usr/lib/qubes/init/NetworkManager-wait-online.service /usr/lib/qubes/init/cups.service @@ -455,6 +456,7 @@ The Qubes core startup configuration for SystemD init. /usr/lib/qubes/init/cups.path /usr/lib/qubes/init/ntpd.service /usr/lib/qubes/init/chronyd.service +%ghost %attr(0644,root,root) /etc/systemd/system/ModemManager.service %ghost %attr(0644,root,root) /etc/systemd/system/NetworkManager.service %ghost %attr(0644,root,root) /etc/systemd/system/NetworkManager-wait-online.service %ghost %attr(0644,root,root) /etc/systemd/system/cups.service @@ -473,7 +475,7 @@ UNITDIR=/lib/systemd/system OVERRIDEDIR=/usr/lib/qubes/init # Install overriden services only when original exists -for srv in cups NetworkManager NetworkManager-wait-online ntpd chronyd; do +for srv in cups ModemManager NetworkManager NetworkManager-wait-online ntpd chronyd; do if [ -f $UNITDIR/$srv.service ]; then cp $OVERRIDEDIR/$srv.service /etc/systemd/system/ fi @@ -514,9 +516,11 @@ rm -f /etc/systemd/system/getty.target.wants/getty@tty*.service /bin/systemctl enable rsyslog.service 2> /dev/null /bin/systemctl enable ntpd.service 2> /dev/null # Disable original service to enable overriden one +/bin/systemctl disable ModemManager.service 2> /dev/null /bin/systemctl disable NetworkManager.service 2> /dev/null # Disable D-BUS activation of NetworkManager - in AppVm it causes problems (eg PackageKit timeouts) /bin/systemctl mask dbus-org.freedesktop.NetworkManager.service 2> /dev/null +/bin/systemctl enable ModemManager.service 2> /dev/null /bin/systemctl enable NetworkManager.service 2> /dev/null # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=974811 /bin/systemctl enable NetworkManager-dispatcher.service 2> /dev/null diff --git a/vm-systemd/ModemManager.service b/vm-systemd/ModemManager.service new file mode 100644 index 0000000..f530073 --- /dev/null +++ b/vm-systemd/ModemManager.service @@ -0,0 +1,4 @@ +.include /lib/systemd/system/ModemManager.service +[Unit] +ConditionPathExists=|/var/run/qubes-service/network-manager +ConditionPathExists=|/var/run/qubes-service/modem-manager