From 8950e52d017b10ec594986900967e97c1c89d77e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 9 Jul 2013 13:30:08 +0200 Subject: [PATCH] cronie: Update to 1.4.9. Add anacron. --- cronie/cronie.nm | 70 ++++++++++++++++++- cronie/patches/cronie-1.4.10-use-setenv.patch | 27 +++++++ 2 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 cronie/patches/cronie-1.4.10-use-setenv.patch diff --git a/cronie/cronie.nm b/cronie/cronie.nm index 0ad2b6ebb..c54104323 100644 --- a/cronie/cronie.nm +++ b/cronie/cronie.nm @@ -4,7 +4,7 @@ ############################################################################### name = cronie -version = 1.4.8 +version = 1.4.9 release = 1 groups = System/Environment/Base @@ -30,21 +30,44 @@ build libselinux-devel pam-devel readline-devel + systemd-units texinfo end configure_options += \ --with-pam \ --with-audit \ - --with-selinux + --with-selinux \ + --with-inotify \ + --enable-anacron \ + --enable-pie \ + --enable-relro install_cmds - mkdir -pv %{BUILDROOT}%{localstatedir}/spool/cron + mkdir -pv %{BUILDROOT}%{localstatedir}/spool/{ana,}cron + + mkdir -pv %{BUILDROOT}%{sysconfdir}/cron.d + touch %{BUILDROOT}%{sysconfdir}/cron.deny + + # Install anacron + install -m 644 contrib/anacrontab %{BUILDROOT}%{sysconfdir}/anacrontab + + mkdir -pv %{BUILDROOT}%{sysconfdir}/cron.hourly + install -c -m 755 contrib/0anacron %{BUILDROOT}%{sysconfdir}/cron.hourly/0anacron + for i in daily weekly monthly; do + touch %{BUILDROOT}%{localstatedir}/spool/anacron/cron.${i} + done + + install -c -m 755 contrib/0hourly %{BUILDROOT}%{sysconfdir}/cron.d/0hourly end end packages package %{name} + requires + dailyjobs + end + # Just search for new unit files that were just installed. script postin systemctl daemon-reload >/dev/null 2>&1 || : @@ -71,6 +94,47 @@ packages end end + package anacron + summary = Utility for running regular jobs. + description + 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. + end + groups = System/Base Base + + provides + dailyjobs + end + + requires + cronie = %{thisver} + crontabs + end + + files + %{sbindir}/anacron + %{sysconfdir}/cron.hourly/0anacron + %{sysconfdir}/anacrontab + %{localstatedir}/spool/anacron + %{mandir}/man*/anacron* + end + + configfiles + %{sysconfdir}/anacrontab + end + + datafiles + %{localstatedir}/spool/anacron/* + end + end + package %{name}-debuginfo template DEBUGINFO end diff --git a/cronie/patches/cronie-1.4.10-use-setenv.patch b/cronie/patches/cronie-1.4.10-use-setenv.patch new file mode 100644 index 000000000..ddbfbbb24 --- /dev/null +++ b/cronie/patches/cronie-1.4.10-use-setenv.patch @@ -0,0 +1,27 @@ +From 5ac31751adfa31c5e5e316afc2f800037bd1cdca Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Thu, 6 Jun 2013 20:13:26 +0200 +Subject: [PATCH] Do not use putenv with string literal. + +--- + src/cron.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cron.c b/src/cron.c +index 9974887..08d0812 100644 +--- a/src/cron.c ++++ b/src/cron.c +@@ -244,8 +244,8 @@ int main(int argc, char *argv[]) { + check_spool_dir(); + + if (ChangePath) { +- if (putenv("PATH=" _PATH_DEFPATH) < 0) { +- log_it("CRON", pid, "DEATH", "can't putenv PATH", ++ if (setenv("PATH", _PATH_DEFPATH, 1) < 0) { ++ log_it("CRON", pid, "DEATH", "can't setenv PATH", + errno); + exit(1); + } +-- +1.7.7.6 + -- 2.47.3