2008-01-30 07:59:43 +00:00
|
|
|
%bcond_without selinux
|
|
|
|
%bcond_without pam
|
|
|
|
%bcond_without audit
|
2008-02-07 14:50:24 +00:00
|
|
|
%bcond_without inotify
|
|
|
|
|
2011-03-15 14:34:50 +00:00
|
|
|
Summary: Cron daemon for executing programs at set times
|
|
|
|
Name: cronie
|
2023-10-17 09:31:30 +00:00
|
|
|
Version: 1.7.0
|
2023-09-11 11:55:34 +00:00
|
|
|
Release: %autorelease
|
2023-09-11 11:53:37 +00:00
|
|
|
License: GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND ISC AND LGPL-2.1-or-later
|
2017-10-16 14:12:41 +00:00
|
|
|
URL: https://github.com/cronie-crond/cronie
|
|
|
|
Source0: https://github.com/cronie-crond/cronie/releases/download/cronie-%{version}/cronie-%{version}.tar.gz
|
2014-11-04 16:50:14 +00:00
|
|
|
|
2024-01-02 10:16:09 +00:00
|
|
|
# https://github.com/cronie-crond/cronie/pull/163
|
|
|
|
Patch: n_option_wait_on_finnishing_grandchild_process.patch
|
|
|
|
|
2011-03-15 14:34:50 +00:00
|
|
|
Requires: dailyjobs
|
2008-01-30 07:59:43 +00:00
|
|
|
|
|
|
|
%if %{with selinux}
|
2011-03-15 14:34:50 +00:00
|
|
|
Requires: libselinux >= 2.0.64
|
2008-06-02 08:01:27 +00:00
|
|
|
Buildrequires: libselinux-devel >= 2.0.64
|
2008-01-30 07:59:43 +00:00
|
|
|
%endif
|
|
|
|
%if %{with pam}
|
2011-03-15 14:34:50 +00:00
|
|
|
Requires: pam >= 1.0.1
|
2008-06-02 08:01:27 +00:00
|
|
|
Buildrequires: pam-devel >= 1.0.1
|
2008-01-30 07:59:43 +00:00
|
|
|
%endif
|
|
|
|
%if %{with audit}
|
|
|
|
Buildrequires: audit-libs-devel >= 1.4.1
|
|
|
|
%endif
|
|
|
|
|
2018-02-21 13:54:51 +00:00
|
|
|
BuildRequires: gcc
|
2013-07-22 12:10:15 +00:00
|
|
|
BuildRequires: systemd
|
2023-10-06 12:46:11 +00:00
|
|
|
BuildRequires: make
|
2013-07-22 12:10:15 +00:00
|
|
|
Obsoletes: %{name}-sysvinit
|
|
|
|
|
2011-05-05 07:05:19 +00:00
|
|
|
Requires(post): coreutils sed
|
2018-11-30 10:35:36 +00:00
|
|
|
|
|
|
|
%if 0%{?fedora} && 0%{?fedora} < 28 || 0%{?rhel} && 0%{?rhel} < 8
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
|
|
|
%{?systemd_ordering} # does not exist on Fedora27/RHEL7
|
|
|
|
%endif
|
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Cronie contains the standard UNIX daemon crond that runs specified programs at
|
|
|
|
scheduled times and related tools. It is a fork of the original vixie-cron and
|
|
|
|
has security and configuration enhancements like the ability to use pam and
|
|
|
|
SELinux.
|
|
|
|
|
2009-07-20 18:12:36 +00:00
|
|
|
%package anacron
|
2011-03-15 14:34:50 +00:00
|
|
|
Summary: Utility for running regular jobs
|
|
|
|
Requires: crontabs
|
|
|
|
Provides: dailyjobs
|
|
|
|
Provides: anacron = 2.4
|
2009-08-05 16:51:09 +00:00
|
|
|
Obsoletes: anacron <= 2.3
|
2009-08-14 13:54:42 +00:00
|
|
|
Requires(post): coreutils
|
2011-03-15 14:34:50 +00:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2009-07-20 18:12:36 +00:00
|
|
|
|
|
|
|
%description anacron
|
2011-06-30 18:51:13 +00:00
|
|
|
Anacron is part of cronie that is used for running jobs with regular
|
|
|
|
periodicity which do not have exact time of day of execution.
|
|
|
|
|
|
|
|
The default settings of anacron execute the daily, weekly, and monthly
|
|
|
|
jobs, but anacron allows setting arbitrary periodicity of jobs.
|
|
|
|
|
|
|
|
Using anacron allows running the periodic jobs even if the system is often
|
|
|
|
powered off and it also allows randomizing the time of the job execution
|
|
|
|
for better utilization of resources shared among multiple systems.
|
2009-07-20 18:12:36 +00:00
|
|
|
|
2009-10-30 16:35:11 +00:00
|
|
|
%package noanacron
|
2011-03-15 14:34:50 +00:00
|
|
|
Summary: Utility for running simple regular jobs in old cron style
|
|
|
|
Provides: dailyjobs
|
|
|
|
Requires: crontabs
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
2009-10-30 16:35:11 +00:00
|
|
|
|
|
|
|
%description noanacron
|
2011-06-30 18:51:13 +00:00
|
|
|
Old style of running {hourly,daily,weekly,monthly}.jobs without anacron. No
|
|
|
|
extra features.
|
2009-10-30 16:35:11 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%prep
|
2021-04-30 10:20:07 +00:00
|
|
|
%autosetup -p1
|
2014-07-11 20:58:39 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%build
|
|
|
|
%configure \
|
|
|
|
%if %{with pam}
|
|
|
|
--with-pam \
|
|
|
|
%endif
|
|
|
|
%if %{with selinux}
|
|
|
|
--with-selinux \
|
|
|
|
%endif
|
|
|
|
%if %{with audit}
|
2008-02-07 14:50:24 +00:00
|
|
|
--with-audit \
|
|
|
|
%endif
|
|
|
|
%if %{with inotify}
|
2009-07-20 18:12:36 +00:00
|
|
|
--with-inotify \
|
2008-01-30 07:59:43 +00:00
|
|
|
%endif
|
2011-03-15 14:34:50 +00:00
|
|
|
--enable-anacron \
|
|
|
|
--enable-pie \
|
|
|
|
--enable-relro
|
2009-07-20 18:12:36 +00:00
|
|
|
|
2020-07-13 18:57:08 +00:00
|
|
|
%make_build V=2
|
2008-01-30 07:59:43 +00:00
|
|
|
|
|
|
|
%install
|
2020-07-13 18:57:08 +00:00
|
|
|
%make_install DESTMAN=$RPM_BUILD_ROOT%{_mandir}
|
2008-01-30 07:59:43 +00:00
|
|
|
mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/cron
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
|
|
|
|
mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
|
|
|
|
%if ! %{with pam}
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/crond
|
|
|
|
%endif
|
2008-09-18 11:08:25 +00:00
|
|
|
install -m 644 crond.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/crond
|
2008-01-30 07:59:43 +00:00
|
|
|
touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny
|
2009-08-14 12:47:30 +00:00
|
|
|
install -m 644 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
|
2009-07-20 18:12:36 +00:00
|
|
|
install -c -m755 contrib/0hourly $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/0hourly
|
|
|
|
mkdir -pm 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly
|
|
|
|
install -c -m755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
|
2009-08-14 12:47:30 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/spool/anacron
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.daily
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.weekly
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly
|
2008-01-30 07:59:43 +00:00
|
|
|
|
2009-10-30 16:35:11 +00:00
|
|
|
# noanacron package
|
2009-11-03 13:50:35 +00:00
|
|
|
install -m 644 contrib/dailyjobs $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/dailyjobs
|
2009-10-30 16:35:11 +00:00
|
|
|
|
2010-11-30 12:00:46 +00:00
|
|
|
# install systemd initscript
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/
|
2012-11-22 14:22:49 +00:00
|
|
|
install -m 644 contrib/cronie.systemd $RPM_BUILD_ROOT/lib/systemd/system/crond.service
|
2010-11-30 12:00:46 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%post
|
2011-10-11 16:31:00 +00:00
|
|
|
# run after an installation
|
2012-09-06 10:00:39 +00:00
|
|
|
%systemd_post crond.service
|
2009-08-14 13:54:42 +00:00
|
|
|
|
|
|
|
%post anacron
|
2017-01-03 09:20:45 +00:00
|
|
|
[ -e /var/spool/anacron/cron.daily ] || touch /var/spool/anacron/cron.daily 2>/dev/null || :
|
|
|
|
[ -e /var/spool/anacron/cron.weekly ] || touch /var/spool/anacron/cron.weekly 2>/dev/null || :
|
|
|
|
[ -e /var/spool/anacron/cron.monthly ] || touch /var/spool/anacron/cron.monthly 2>/dev/null || :
|
2008-02-05 14:50:39 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%preun
|
2011-10-11 16:31:00 +00:00
|
|
|
# run before a package is removed
|
2012-09-06 10:00:39 +00:00
|
|
|
%systemd_preun crond.service
|
2008-01-30 07:59:43 +00:00
|
|
|
|
|
|
|
%postun
|
2011-10-11 16:31:00 +00:00
|
|
|
# run after a package is removed
|
2012-09-06 10:00:39 +00:00
|
|
|
%systemd_postun_with_restart crond.service
|
2008-01-30 07:59:43 +00:00
|
|
|
|
2011-10-17 13:06:41 +00:00
|
|
|
%triggerun -- cronie-anacron < 1.4.1
|
2011-05-05 07:05:19 +00:00
|
|
|
# empty /etc/crontab in case there are only old regular jobs
|
2009-08-14 12:47:30 +00:00
|
|
|
cp -a /etc/crontab /etc/crontab.rpmsave
|
|
|
|
sed -e '/^01 \* \* \* \* root run-parts \/etc\/cron\.hourly/d'\
|
|
|
|
-e '/^02 4 \* \* \* root run-parts \/etc\/cron\.daily/d'\
|
|
|
|
-e '/^22 4 \* \* 0 root run-parts \/etc\/cron\.weekly/d'\
|
|
|
|
-e '/^42 4 1 \* \* root run-parts \/etc\/cron\.monthly/d' /etc/crontab.rpmsave > /etc/crontab
|
|
|
|
exit 0
|
|
|
|
|
2011-05-05 07:05:19 +00:00
|
|
|
%triggerun -- cronie < 1.4.7-2
|
|
|
|
# Save the current service runlevel info
|
|
|
|
# User must manually run systemd-sysv-convert --apply crond
|
|
|
|
# to migrate them to systemd targets
|
|
|
|
/usr/bin/systemd-sysv-convert --save crond
|
2008-02-05 14:50:39 +00:00
|
|
|
|
2011-05-05 07:05:19 +00:00
|
|
|
# The package is allowed to autostart:
|
|
|
|
/bin/systemctl enable crond.service >/dev/null 2>&1
|
|
|
|
|
|
|
|
/sbin/chkconfig --del crond >/dev/null 2>&1 || :
|
|
|
|
/bin/systemctl try-restart crond.service >/dev/null 2>&1 || :
|
|
|
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
|
|
|
|
|
|
%triggerin -- pam, glibc, libselinux
|
|
|
|
# changes in pam, glibc or libselinux can make crond crash
|
|
|
|
# when it calls pam
|
|
|
|
/bin/systemctl try-restart crond.service >/dev/null 2>&1 || :
|
2011-06-30 18:51:13 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%files
|
2014-07-11 20:58:39 +00:00
|
|
|
%doc AUTHORS README ChangeLog
|
|
|
|
%{!?_licensedir:%global license %%doc}
|
2014-09-17 15:13:50 +00:00
|
|
|
%license COPYING
|
2008-01-30 07:59:43 +00:00
|
|
|
%attr(755,root,root) %{_sbindir}/crond
|
2013-01-02 14:34:33 +00:00
|
|
|
%attr(4755,root,root) %{_bindir}/crontab
|
2018-05-03 17:06:15 +00:00
|
|
|
%attr(755,root,root) %{_bindir}/cronnext
|
2008-01-30 07:59:43 +00:00
|
|
|
%{_mandir}/man8/crond.*
|
|
|
|
%{_mandir}/man8/cron.*
|
|
|
|
%{_mandir}/man5/crontab.*
|
|
|
|
%{_mandir}/man1/crontab.*
|
2018-05-03 17:06:15 +00:00
|
|
|
%{_mandir}/man1/cronnext.*
|
2008-01-30 07:59:43 +00:00
|
|
|
%dir %{_localstatedir}/spool/cron
|
|
|
|
%dir %{_sysconfdir}/cron.d
|
|
|
|
%if %{with pam}
|
|
|
|
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/crond
|
|
|
|
%endif
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/crond
|
2022-06-28 14:01:25 +00:00
|
|
|
%config(noreplace,missingok) %{_sysconfdir}/cron.deny
|
2015-04-21 13:40:08 +00:00
|
|
|
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/0hourly
|
2010-11-30 12:00:46 +00:00
|
|
|
%attr(0644,root,root) /lib/systemd/system/crond.service
|
2009-07-20 18:12:36 +00:00
|
|
|
|
|
|
|
%files anacron
|
|
|
|
%{_sbindir}/anacron
|
2013-01-02 15:09:32 +00:00
|
|
|
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
|
2009-11-03 13:50:35 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/anacrontab
|
2009-08-14 12:47:30 +00:00
|
|
|
%dir /var/spool/anacron
|
2015-02-03 11:33:18 +00:00
|
|
|
%ghost %attr(0600,root,root) %verify(not md5 size mtime) /var/spool/anacron/cron.daily
|
|
|
|
%ghost %attr(0600,root,root) %verify(not md5 size mtime) /var/spool/anacron/cron.weekly
|
|
|
|
%ghost %attr(0600,root,root) %verify(not md5 size mtime) /var/spool/anacron/cron.monthly
|
2009-07-20 18:12:36 +00:00
|
|
|
%{_mandir}/man5/anacrontab.*
|
|
|
|
%{_mandir}/man8/anacron.*
|
2008-01-30 07:59:43 +00:00
|
|
|
|
2009-10-30 16:35:11 +00:00
|
|
|
%files noanacron
|
2015-04-21 13:40:08 +00:00
|
|
|
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs
|
2009-10-30 16:35:11 +00:00
|
|
|
|
2008-01-30 07:59:43 +00:00
|
|
|
%changelog
|
2023-09-11 11:55:34 +00:00
|
|
|
%autochangelog
|