systemd init script (replacement)

This commit is contained in:
Marcela Mašláňová 2010-11-30 13:00:46 +01:00
parent aa4c6f7311
commit 0361d4cf7f
3 changed files with 23 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
cronie-1.4.4.tar.gz
cronie-1.4.5.tar.gz
/cronie-1.4.6.tar.gz
/cronie.systemd

View File

@ -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á <mmaslano@redhat.com> - 1.4.6-3
- systemd init script 617320
* Tue Nov 30 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-2
- fix typos in man pages

View File

@ -1 +1,2 @@
968e3d3e7c8e1d0588d533883482d3fa cronie-1.4.6.tar.gz
01014d53a9ede7c45f2419dc023cc372 cronie.systemd