Package init
This commit is contained in:
commit
aa00522c3c
30
Revert-Avoid-creating-pid-files.patch
Normal file
30
Revert-Avoid-creating-pid-files.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 04d556ba1f3c18508c51231fa12a6d8f0bddf36c Mon Sep 17 00:00:00 2001
|
||||
From: root <root@localhost.localdomain>
|
||||
Date: Tue, 23 Jul 2019 07:54:07 -0400
|
||||
Subject: [PATCH] Revert "Avoid creating pid files when crond doesn't fork"
|
||||
Reason: The PID file is useful to avoid running multiple crond instances
|
||||
at once.
|
||||
Source: https://github.com/cronie-crond/cronie/commit/0570c2cd979bc9ce1da6a873089e89dbca900a1f
|
||||
|
||||
Signed-off-by: root <root@localhost.localdomain>
|
||||
---
|
||||
src/misc.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/misc.c b/src/misc.c
|
||||
index 4efab64..587c761 100644
|
||||
--- a/src/misc.c
|
||||
+++ b/src/misc.c
|
||||
@@ -315,9 +315,6 @@ void acquire_daemonlock(int closeflag) {
|
||||
return;
|
||||
}
|
||||
|
||||
- if (NoFork == 1)
|
||||
- return; //move along, nothing to do here...
|
||||
-
|
||||
if (fd == -1) {
|
||||
pidfile = _PATH_CRON_PID;
|
||||
/* Initial mode is 0600 to prevent flock() race/DoS. */
|
||||
--
|
||||
2.19.1
|
||||
|
||||
22
bugfix-cronie-systemd-alias.patch
Normal file
22
bugfix-cronie-systemd-alias.patch
Normal file
@ -0,0 +1,22 @@
|
||||
From 4c99d56c0f7c0240298d39decda41c02b337b947 Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Mon, 26 Aug 2019 14:19:45 +0000
|
||||
Subject: [PATCH] alias crond.service as cron.service
|
||||
|
||||
---
|
||||
contrib/cronie.systemd | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/contrib/cronie.systemd b/contrib/cronie.systemd
|
||||
index 19f2a98..adaa18a 100644
|
||||
--- a/contrib/cronie.systemd
|
||||
+++ b/contrib/cronie.systemd
|
||||
@@ -12,4 +12,4 @@ RestartSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
-
|
||||
+Alias=cron.service
|
||||
--
|
||||
2.19.1
|
||||
|
||||
BIN
cronie-1.5.4.tar.gz
Normal file
BIN
cronie-1.5.4.tar.gz
Normal file
Binary file not shown.
126
cronie.spec
Normal file
126
cronie.spec
Normal file
@ -0,0 +1,126 @@
|
||||
Name: cronie
|
||||
Version: 1.5.4
|
||||
Release: 3
|
||||
Summary: Standard UNIX daemon crond
|
||||
License: GPLv2+ and ISC
|
||||
URL: https://github.com/cronie-crond/cronie
|
||||
Source0: https://github.com/cronie-crond/cronie/releases/download/cronie-%{version}-final/cronie-%{version}.tar.gz
|
||||
|
||||
Patch6000: Revert-Avoid-creating-pid-files.patch
|
||||
|
||||
Patch9000: bugfix-cronie-systemd-alias.patch
|
||||
|
||||
|
||||
BuildRequires: gcc systemd libselinux-devel pam-devel audit-libs-devel git
|
||||
|
||||
Requires: libselinux pam crontabs
|
||||
|
||||
Provides: dailyjobs anacron %{name}-anacron %{name}-noanacron
|
||||
|
||||
Obsoletes: %{name}-anacron %{name}-noanacron
|
||||
|
||||
%description
|
||||
Cronie contains the standard UNIX daemon crond that runs specified programs
|
||||
at scheduled times and related tools. It is based on the original cron and
|
||||
has security and configuration enhancements like the ability to use pam and SELinux.
|
||||
|
||||
%package help
|
||||
Summary: Man pages and other related documents for cronie
|
||||
BuildArch:noarch
|
||||
%description help
|
||||
Man pages and other related documents for cronie.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -S git
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--with-pam \
|
||||
--with-selinux \
|
||||
--with-audit \
|
||||
--with-inotify \
|
||||
--enable-anacron \
|
||||
--enable-pie \
|
||||
--enable-relro
|
||||
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/cron
|
||||
mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
|
||||
mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d
|
||||
mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly
|
||||
mkdir -pm755 $RPM_BUILD_ROOT%{_localstatedir}/spool/anacron
|
||||
|
||||
install -m 644 crond.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/crond
|
||||
install -m 644 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
|
||||
install -m 644 contrib/0hourly $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/0hourly
|
||||
install -m 755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
|
||||
|
||||
touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny
|
||||
touch $RPM_BUILD_ROOT%{_localstatedir}/spool/anacron/{cron.daily,cron.weekly,cron.monthly}
|
||||
|
||||
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 contrib/cronie.systemd $RPM_BUILD_ROOT/lib/systemd/system/crond.service
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
%pre
|
||||
|
||||
%preun
|
||||
%systemd_preun crond.service
|
||||
|
||||
%post
|
||||
%systemd_post crond.service
|
||||
[ -e %{_localstatedir}/spool/anacron/cron.daily ] || touch %{_localstatedir}/spool/anacron/cron.daily 2>/dev/null || :
|
||||
[ -e %{_localstatedir}/spool/anacron/cron.weekly ] || touch %{_localstatedir}/spool/anacron/cron.weekly 2>/dev/null || :
|
||||
[ -e %{_localstatedir}/spool/anacron/cron.monthly ] || touch %{_localstatedir}/spool/anacron/cron.monthly 2>/dev/null || :
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart crond.service
|
||||
|
||||
%triggerin -- pam, glibc, libselinux
|
||||
systemctl try-restart crond.service >/dev/null 2>&1 || :
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
|
||||
%doc AUTHORS ChangeLog COPYING README
|
||||
|
||||
%dir %{_sysconfdir}/cron.d
|
||||
%dir %{_localstatedir}/spool/cron
|
||||
%dir %{_localstatedir}/spool/anacron
|
||||
%ghost %attr(0644,root,root) %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/{cron.daily,cron.weekly,cron.monthly}
|
||||
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs
|
||||
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
|
||||
%config(noreplace) %{_sysconfdir}/anacrontab
|
||||
%config(noreplace) %{_sysconfdir}/pam.d/crond
|
||||
%config(noreplace) %{_sysconfdir}/cron.deny
|
||||
%config(noreplace) %{_sysconfdir}/cron.d/0hourly
|
||||
%attr(0644,root,root) /lib/systemd/system/crond.service
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/crond
|
||||
|
||||
%{_sbindir}/crond
|
||||
%{_sbindir}/anacron
|
||||
%{_bindir}/crontab
|
||||
%{_bindir}/cronnext
|
||||
|
||||
|
||||
%files help
|
||||
%{_mandir}/{man1,man5,man8}/*
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Sep 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.5.4-3
|
||||
- Add license "ISC"
|
||||
|
||||
* Thu Aug 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.5.4-2
|
||||
- Build noarch for Help Package
|
||||
|
||||
* Tue Aug 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.5.4-1
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user