systemd init script (replacement)
This commit is contained in:
parent
aa4c6f7311
commit
0361d4cf7f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
cronie-1.4.4.tar.gz
|
||||
cronie-1.4.5.tar.gz
|
||||
/cronie-1.4.6.tar.gz
|
||||
/cronie.systemd
|
||||
|
22
cronie.spec
22
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á <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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user