-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathcronie.spec
548 lines (410 loc) · 19.7 KB
/
cronie.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
%bcond_without selinux
%bcond_without pam
%bcond_without audit
%bcond_without inotify
Summary: Cron daemon for executing programs at set times
Name: cronie
Version: 1.7.2
Release: 0packit%{?dist}
License: MIT and BSD and ISC and GPLv2+
URL: https://github.com/cronie-crond/cronie
Source0: https://github.com/cronie-crond/cronie/releases/download/cronie-%{version}/cronie-%{version}.tar.gz
Requires: dailyjobs
%if %{with selinux}
Requires: libselinux >= 2.0.64
Buildrequires: libselinux-devel >= 2.0.64
%endif
%if %{with pam}
Requires: pam >= 1.0.1
Buildrequires: pam-devel >= 1.0.1
%endif
%if %{with audit}
Buildrequires: audit-libs-devel >= 1.4.1
%endif
# Necessary for packit
BuildRequires: autoconf, automake, libtool
BuildRequires: gcc
BuildRequires: systemd
BuildRequires: make
Obsoletes: %{name}-sysvinit
Requires(post): coreutils sed
%if 0%{?fedora} && 0%{?fedora} < 28 || 0%{?rhel} && 0%{?rhel} < 8
%{?systemd_requires}
%else
%{?systemd_ordering} # does not exist on Fedora27/RHEL7
%endif
%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.
%package anacron
Summary: Utility for running regular jobs
Requires: crontabs
Provides: dailyjobs
Provides: anacron = 2.4
Obsoletes: anacron <= 2.3
Requires(post): coreutils
Requires: %{name} = %{version}-%{release}
%description anacron
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.
%package noanacron
Summary: Utility for running simple regular jobs in old cron style
Provides: dailyjobs
Requires: crontabs
Requires: %{name} = %{version}-%{release}
%description noanacron
Old style of running {hourly,daily,weekly,monthly}.jobs without anacron. No
extra features.
%prep
%autosetup -p1
%build
./autogen.sh
%configure \
%if %{with pam}
--with-pam \
%endif
%if %{with selinux}
--with-selinux \
%endif
%if %{with audit}
--with-audit \
%endif
%if %{with inotify}
--with-inotify \
%endif
--enable-anacron \
--enable-pie \
--enable-relro
%make_build V=2
%install
%make_install DESTMAN=$RPM_BUILD_ROOT%{_mandir}
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
install -m 644 crond.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/crond
touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny
install -m 644 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
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
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
# 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 contrib/cronie.systemd $RPM_BUILD_ROOT/lib/systemd/system/crond.service
%post
# run after an installation
%systemd_post crond.service
%post anacron
[ -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 || :
%preun
# run before a package is removed
%systemd_preun crond.service
%postun
# run after a package is removed
%systemd_postun_with_restart crond.service
%triggerun -- cronie-anacron < 1.4.1
# empty /etc/crontab in case there are only old regular jobs
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
%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
# 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 || :
%files
%doc AUTHORS README ChangeLog
%{!?_licensedir:%global license %%doc}
%license COPYING
%attr(755,root,root) %{_sbindir}/crond
%attr(4755,root,root) %{_bindir}/crontab
%attr(755,root,root) %{_bindir}/cronnext
%{_mandir}/man8/crond.*
%{_mandir}/man8/cron.*
%{_mandir}/man5/crontab.*
%{_mandir}/man1/crontab.*
%{_mandir}/man1/cronnext.*
%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
%config(noreplace) %{_sysconfdir}/cron.deny
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/0hourly
%attr(0644,root,root) /lib/systemd/system/crond.service
%files anacron
%{_sbindir}/anacron
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
%config(noreplace) %{_sysconfdir}/anacrontab
%dir /var/spool/anacron
%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
%{_mandir}/man5/anacrontab.*
%{_mandir}/man8/anacron.*
%files noanacron
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs
%changelog
- Packit build
- new upstream release 1.5.7 with bug fixes and enhancements
- new upstream release 1.5.6 with bug fixes and enhancements
** Thu Oct 31 2019 Tomáš Mráz <[email protected]> - 1.5.5-1
- new upstream release 1.5.5 with multiple bug fixes and improvements
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
- new upstream release 1.5.4 with regression fix
- new upstream release 1.5.3 fixing CVE-2019-9704 and CVE-2019-9705
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
- Do not hard-require systemd as crond is used in containers without
systemd (#1654659)
- use role from the current context for system crontabs (#1639381)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
- new upstream release 1.5.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
- fix Y2038 problems in cron and anacron (#1445136)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
- make failure of creation of the ghost files in /var non-fatal
- on some machines the power supply is named ADP0
- query power status directly from kernel
- new upstream release
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
- the temp file name used by crontab needs to be ignored by crond
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
- new upstream release
- mark the 0hourly and dailyjobs crontabs as config
- do not add already existing orphan on reload
- correct the permissions of the anacron timestamp files
- check for NULL pamh on two more places (#1176215)
- call PAM only for non-root user or non-system crontabs (#956157)
- bypass the PAM check in crontab for root (#1169175)
- refresh user entries when jobs are run
- new release 1.4.12
- remove gpl2 license, because it's part of upstream COPYING now
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
- fix license handling
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
- unwanted fd could make trouble to SElinux 1075106
- Drop INSTALL from docs, fix rpmlint tabs vs spaces warning.
- some jobs are not executed because not all environment variables are set 995590
- cronie's systemd script use "KillMode=process" 919290
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
- scriptlets are not created correctly if systemd is not in BR 986698
- remove sub-package sysvinit, which is not needed anymore
- update license, anacron is under GPLv2+
- new release 1.4.11 (contains previous bug fixes from 1.4.10-5)
- add support for RANDOM_DELAY - delaying job startups
- pass some environment variables to processes (LANG, etc.) (#969761)
- do not use putenv() with string literals (#971516)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
- change configuration files to 644
- change 6755 to 4755 for crontab binary
- New release 1.4.10
- New release 1.4.9
- Scriptlets replaced with new systemd macros (#850070)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
- Rebuilt for glibc bug#747377
- make crond run a little bit later in the boot process (#747759)
- change triggerun to fix 735802 during upgrade
- rebuild again, ppc still had the broken rpm in the buildroots
- rebuild (broken rpm in buildroot)
- fix permission of init.d/crond
- drop the without systemd build condition
- add the chkconfig re-adding trigger to the sysvinit subpackage
- start crond after auditd
- fix inotify support to not leak fds (#717505)
- update to 1.4.8
- create sub-package sysvinit for initscript
- missing requirement on systemd-sysv for scriptlets
- use only systemd units with systemd
- add trigger for restart on glibc, libselinux or pam upgrades (#699189)
- new release 1.4.7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
- enable crond even with systemctl
- 663193 rewritten selinux support
- apply selinux patch from dwalsh
- do not lock jobs that fall out of allowed range - 661966
- fix post (thanks plautrba for review)
- systemd init script 617320
- fix typos in man pages
- update to 1.4.6
- 623908 fix fd leak in anacron, which caused denail of prelink
and others
- remove sendmail from requirements. If it's not installed, it will
log into (r)syslog.
- update to new release
- update to new release
- 564894 FTBFS DSOLinking
- 533189 pam needs add a line and selinux needs defined one function
- 531963 and 532482 creating noanacron package
- 529632 service crond stop returns appropriate value
- new release
- rebuilt with new audit
- create the anacron timestamps in correct post script
- update to 1.4.1
- create and own /var/spool/anacron/cron.{daily,weekly,monthly} to
remove false warning about non existent files
- Resolves: 517398
- 515762 move anacron provides and obsoletes to the anacron subpackage
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
- merge cronie and anacron in new release of cronie
- obsolete/provide anacron in spec
- 506560 check return value of access
- new release
- 496973 close file descriptors after exec
- rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
- 477100 NO_FOLLOW was removed, reload after change in symlinked
crontab is needed, man updated.
- update init script
- add sendmail file into requirement, cause it's needed some MTA
- 462252 /etc/sysconfig/crond does not need to be executable
- update to 1.2
- fix setting keycreate context
- unify logging a bit
- cleanup some warnings and fix a typo in TZ code
- 450993 improve and fix inotify support
- 49864 upgrade/update problem. Syntax error in spec.
- release 1.1
- 446360 check for lock didn't call chkconfig
- upgrade from less than cronie-1.0-4 didn't add chkconfig
- 431366 after reboot wasn't cron in chkconfig
- 431366 trigger part => after update from vixie-cron on cronie will
be daemon running.
- change the provides on higher version than obsoletes
- packaging cronie
- thank's for help with packaging to my reviewers