diff --git a/.gitignore b/.gitignore index 0ac3da6..22bf3f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ cronie-1.4.4.tar.gz cronie-1.4.5.tar.gz /cronie-1.4.6.tar.gz +/cronie.systemd diff --git a/cronie.spec b/cronie.spec index 5aaefa1..055f053 100644 --- a/cronie.spec +++ b/cronie.spec @@ -6,11 +6,12 @@ Summary: Cron daemon for executing programs at set times Name: cronie Version: 1.4.6 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT and BSD and ISC and GPLv2 Group: System Environment/Base URL: https://fedorahosted.org/cronie Source0: https://fedorahosted.org/releases/c/r/cronie/%{name}-%{version}.tar.gz +Source1: cronie.systemd Patch0: cronie-1.4.6-manpages.patch Requires: syslog, bash >= 2.0 @@ -37,6 +38,10 @@ Requires(postun): /sbin/chkconfig Requires(postun): /sbin/service Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service +# systemd compatibility +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units %description Cronie contains the standard UNIX daemon crond that runs specified programs at @@ -116,11 +121,17 @@ touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly # noanacron package install -m 644 contrib/dailyjobs $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/dailyjobs +# install systemd initscript +mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/ +install -m 644 %SOURCE1 $RPM_BUILD_ROOT/lib/systemd/system/crond.service + %clean rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add crond +# systemd +/bin/systemctl enable crond.service >/dev/null 2>&1 || : %post anacron [ -e /var/spool/anacron/cron.daily ] || touch /var/spool/anacron/cron.daily @@ -131,11 +142,16 @@ rm -rf $RPM_BUILD_ROOT if [ "$1" = "0" ]; then service crond stop >/dev/null 2>&1 ||: /sbin/chkconfig --del crond + # systemd + /bin/systemctl disable crond.service >/dev/null 2>&1 || : + /bin/systemctl stop crond.service > /dev/null 2>&1 || : fi %postun if [ "$1" -ge "1" ]; then service crond condrestart > /dev/null 2>&1 ||: + # systemd + /bin/systemctl try-restart crond.service >/dev/null 2>&1 || : fi # empty /etc/crontab in case there are only old regular jobs @@ -175,6 +191,7 @@ cp -a /var/lock/subsys/crond /var/lock/subsys/cronie > /dev/null 2>&1 ||: %config(noreplace) %{_sysconfdir}/sysconfig/crond %config(noreplace) %{_sysconfdir}/cron.deny %attr(0644,root,root) %{_sysconfdir}/cron.d/0hourly +%attr(0644,root,root) /lib/systemd/system/crond.service %files anacron %defattr(-,root,root,-) @@ -193,6 +210,9 @@ cp -a /var/lock/subsys/crond /var/lock/subsys/cronie > /dev/null 2>&1 ||: %attr(0644,root,root) %{_sysconfdir}/cron.d/dailyjobs %changelog +* Tue Nov 30 2010 Marcela Mašláňová - 1.4.6-3 +- systemd init script 617320 + * Tue Nov 30 2010 Marcela Mašláňová - 1.4.6-2 - fix typos in man pages diff --git a/sources b/sources index 7b170f3..10cf035 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 968e3d3e7c8e1d0588d533883482d3fa cronie-1.4.6.tar.gz +01014d53a9ede7c45f2419dc023cc372 cronie.systemd