From efb79d5784afce1bd0a40dcc3b2127070bca8e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 14 Jan 2015 02:46:29 +0100 Subject: [PATCH] systemd: allow to start cron daemon (#909) --- Makefile | 1 + rpm_spec/core-vm.spec | 8 +++++++- vm-systemd/crond.service | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 vm-systemd/crond.service diff --git a/Makefile b/Makefile index ad51d42..1ff610e 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,7 @@ install-systemd: install -m 0644 vm-systemd/cups.* $(DESTDIR)$(LIBDIR)/qubes/init/ install -m 0644 vm-systemd/ntpd.service $(DESTDIR)$(LIBDIR)/qubes/init/ install -m 0644 vm-systemd/chronyd.service $(DESTDIR)$(LIBDIR)/qubes/init/ + install -m 0644 vm-systemd/crond.service $(DESTDIR)$(LIBDIR)/qubes/init/ install-sysvinit: install -d $(DESTDIR)/etc/init.d diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index c825498..89a8cb7 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -561,6 +561,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 +/usr/lib/qubes/init/crond.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 @@ -580,7 +581,7 @@ done rm -f /etc/systemd/system/default.target ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target -DISABLE_SERVICES="alsa-store alsa-restore auditd avahi avahi-daemon backuppc cpuspeed crond" +DISABLE_SERVICES="alsa-store alsa-restore auditd avahi avahi-daemon backuppc cpuspeed" DISABLE_SERVICES="$DISABLE_SERVICES fedora-autorelabel fedora-autorelabel-mark ipmi hwclock-load hwclock-save" DISABLE_SERVICES="$DISABLE_SERVICES mdmonitor multipathd openct rpcbind mcelog fedora-storage-init fedora-storage-init-late" DISABLE_SERVICES="$DISABLE_SERVICES plymouth-start plymouth-read-write plymouth-quit plymouth-quit-wait" @@ -604,6 +605,7 @@ rm -f /etc/systemd/system/getty.target.wants/getty@tty*.service /bin/systemctl --no-reload enable ip6tables.service 2> /dev/null /bin/systemctl --no-reload enable rsyslog.service 2> /dev/null /bin/systemctl --no-reload enable ntpd.service 2> /dev/null +/bin/systemctl --no-reload enable crond.service 2> /dev/null # Enable cups only when it is real SystemD service [ -e /lib/systemd/system/cups.service ] && /bin/systemctl --no-reload enable cups.service 2> /dev/null @@ -624,6 +626,10 @@ exit 0 %installOverridenServices cups exit 0 +%triggerin systemd -- cronie +%installOverridenServices crond +exit 0 + %triggerin systemd -- haveged /bin/systemctl enable haveged.service 2> /dev/null exit 0 diff --git a/vm-systemd/crond.service b/vm-systemd/crond.service new file mode 100644 index 0000000..c1876d0 --- /dev/null +++ b/vm-systemd/crond.service @@ -0,0 +1,10 @@ +.include /lib/systemd/system/crond.service +[Unit] +ConditionPathExists=/var/run/qubes-service/crond +# For /rw +After=qubes-misc-post.service + +[Service] +ExecStartPre=/bin/mkdir --mode=0700 -p /rw/cron +ExecStartPre=/bin/mount --bind /rw/cron /var/spool/cron +ExecStopPost=/bin/umount /var/spool/cron