77.11. cronie-1.7.2
Cron daemon and crontab: the scheduler for the crontabs users write
1.7.2-1 · ISC · 0.2 SBU · 294.3 KiB, 12 files · 41_system, 207 of 1047 · ports/core/base/cronie
Homepage: https://github.com/cronie-crond/cronie
cronie is the cron of Fedora and RHEL: crond, the daemon that runs each user’s scheduled jobs, and crontab, the program a user installs, lists and removes their crontab with, plus cronnext, which prints when a job runs next.
On KDOS it is the scheduler for the crontabs people write, and only for those. System Settings’ Task Scheduler page (kcron) edits a user’s jobs through crontab. The system’s own schedules are not cron jobs: they stay snooze timers in /etc/kdos/timers.d, run by 18_timers.sh, and a user’s timers in ~/.config/kdos/timers.d are run by their user services. crond is started at boot from an init script under ksvc. See No systemd init, units or service manager.
Depends on: nano.
Required by (1): kcron.
Sources: cronie-1.7.2.tar.gz (266.1 KiB). Every step kpkg takes applies to this port.
Optional, off in KDOS. These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
--without-pam, line 20: pam (explained with the switches below)
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install cronie'
build.sh:
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--runstatedir=/run \
--disable-anacron \
--disable-syscrontab \
--with-inotify \
--without-pam \
--without-selinux \
--without-audit \
--with-editor=/usr/bin/nano
make
make DESTDIR=$PKG install
chmod 4755 "$PKG/usr/bin/crontab"
install -d -m 755 "$PKG/etc/cron.d"
install -m 644 /dev/null "$PKG/etc/cron.deny"
--localstatedir=/var— Keep the crontabs in/var/spool/cron/<user>. Left at its default, the spool would be/usr/var/spool/cron.--runstatedir=/run— Writecrond.pidin/run. The default is<localstatedir>/run.--disable-anacron— Build noanacron, which catches up daily, weekly and monthly jobs a powered-off machine missed. Those are system schedules, which aresnooze’s. It also leaves out the copy of glibc’sobstackanacron needs on musl.--disable-syscrontab—cronddoes not read/etc/crontab. A system job belongs in/etc/kdos/timers.d, wheresnoozeruns it; with two places for system schedules a job could be written to the one nobody reads. kcron’s system-crontab page edits/etc/crontab, so its entries do not run./etc/cron.dis read whatever this says, and no port installs anything there.--with-inotify—crondwatches the spool and/etc/cron.dwith inotify and reloads a crontab as soon as it changes, instead of checking modification times once a minute.--without-pam— Run jobs without opening a PAM session. With PAM,crondandcrontabneed their own service file, because/etc/pam.d/otherdenies everything; a job then registers no elogind session, which a job does not need.--without-selinux,--without-audit— No SELinux contexts and no Linux audit records. Neither library is a port.--with-editor=/usr/bin/nano— The editorcrontab -eruns when neitherVISUALnorEDITORis set. Left at its default, configure looks forvion the build machine and compiles in/usr/bin/vi, which the image does not have. nano is independsfor this.
Programs: crond, cronnext, crontab.
Directories: /etc/cron.d, /usr/share/licenses/cronie.
crontab is setuid root. It writes /var/spool/cron/<user> and touches the spool directory, which is mode 0700 and owned by root; an ordinary user can do neither, and crontab drops back to the caller’s identity for everything else (running the editor, reading the new file). make install installs it 0755, so the recipe sets mode 4755 itself. It is setuid, not setgid to a crontab group as some distributions build it, because KDOS ships no setgid binary; see setuid binaries. The spool directory is not in the package, because kpkgadd would create it 0755; the init script, /etc/init.d/85_crond.sh, creates it 0700 when it is missing, before it starts crond, which refuses to start without it.
/etc/cron.deny ships empty. crontab refuses every user but root unless /etc/cron.allow or /etc/cron.deny exists; an empty deny list lets every account keep a crontab. The recipe also creates the empty /etc/cron.d, which crond reads at every reload and logs a failure for when it is missing.
Job output. Without -s, crond mails a job’s output through /usr/sbin/sendmail, which on KDOS is msmtp and has nowhere to deliver a local message. The init script runs crond -n -s -m off -P:
-nkeeps it in the foreground, forksvcto supervise.-ssends a job’s output to syslog, under cron’s own facility.-m offstopscrondtrying to mail anything at all.-Plets a job inherit the daemon’sPATH, which the boot scripts extend with/usr/local, so a job that nameskdosby its bare name finds it.
Alpine carries one patch, completing the error_func prototype of load_entry() for GCC 15’s default C23. The tree compiles C with -std=gnu11, under which the original declaration is valid, so the patch is not carried.