Package: cron
Version: 3.0pl1-130

Apparently the users' @reboot cron jobs might be run before the
system init scripts have been completed. Sample (using sysv init):

# ls -al /etc/rc2.d/
total 20
drwxr-xr-x   2 root root  4096 Jan  2 14:44 .
drwxr-xr-x 153 root root 12288 Jan  2 14:44 ..
lrwxrwxrwx   1 root root    29 Mar 29  2016 K01apache-htcacheclean -> 
../init.d/apache-htcacheclean
-rw-r--r--   1 root root   677 Dec 27 10:49 README
lrwxrwxrwx   1 root root    26 Jan  2 06:51 S01console-setup.sh -> 
../init.d/console-setup.sh
lrwxrwxrwx   1 root root    22 Jan  2 06:51 S02acpi-fakekey -> 
../init.d/acpi-fakekey
lrwxrwxrwx   1 root root    16 Jan  2 06:51 S02dhcpcd -> ../init.d/dhcpcd
lrwxrwxrwx   1 root root    22 Jan  2 06:51 S02lvm2-lvmetad -> 
../init.d/lvm2-lvmetad
lrwxrwxrwx   1 root root    23 Jan  2 06:51 S02lvm2-lvmpolld -> 
../init.d/lvm2-lvmpolld
lrwxrwxrwx   1 root root    18 Jan  2 06:51 S02minidlna -> ../init.d/minidlna
lrwxrwxrwx   1 root root    14 Jan  2 06:51 S02motd -> ../init.d/motd
lrwxrwxrwx   1 root root    17 Jan  2 06:51 S02rsyslog -> ../init.d/rsyslog
lrwxrwxrwx   1 root root    14 Jan  2 06:51 S02sudo -> ../init.d/sudo
lrwxrwxrwx   1 root root    15 Jan  2 06:51 S02uuidd -> ../init.d/uuidd
lrwxrwxrwx   1 root root    19 Jan  2 06:51 S02zfs-mount -> ../init.d/zfs-mount
lrwxrwxrwx   1 root root    22 Jan  2 06:52 S03acpi-support -> 
../init.d/acpi-support
lrwxrwxrwx   1 root root    15 Jan  2 06:52 S03acpid -> ../init.d/acpid
lrwxrwxrwx   1 root root    17 Jan  2 06:52 S03anacron -> ../init.d/anacron
lrwxrwxrwx   1 root root    13 Jan  2 06:52 S03atd -> ../init.d/atd
lrwxrwxrwx   1 root root    16 Jan  2 06:52 S03autofs -> ../init.d/autofs
lrwxrwxrwx   1 root root    23 Jan  2 06:52 S03clamav-daemon -> 
../init.d/clamav-daemon
lrwxrwxrwx   1 root root    14 Jan  2 06:52 S03dbus -> ../init.d/dbus
lrwxrwxrwx   1 root root    17 Jan  2 06:52 S03dnsmasq -> ../init.d/dnsmasq
lrwxrwxrwx   1 root root    20 Jan  2 06:52 S03git-daemon -> 
../init.d/git-daemon
lrwxrwxrwx   1 root root    21 Jan  2 06:52 S03loadcpufreq -> 
../init.d/loadcpufreq
lrwxrwxrwx   1 root root    14 Jan  2 06:52 S03nscd -> ../init.d/nscd
lrwxrwxrwx   1 root root    13 Jan  2 06:52 S03ntp -> ../init.d/ntp
lrwxrwxrwx   1 root root    19 Jan  2 06:52 S03opensmtpd -> ../init.d/opensmtpd
lrwxrwxrwx   1 root root    19 Jan  2 06:52 S03rmnologin -> ../init.d/rmnologin
lrwxrwxrwx   1 root root    23 Jan  2 06:52 S03smartmontools -> 
../init.d/smartmontools
lrwxrwxrwx   1 root root    22 Jan  2 06:52 S03spamassassin -> 
../init.d/spamassassin
lrwxrwxrwx   1 root root    13 Jan  2 06:52 S03ssh -> ../init.d/ssh
lrwxrwxrwx   1 root root    17 Jan  2 06:52 S04apache2 -> ../init.d/apache2
lrwxrwxrwx   1 root root    23 Jan  2 06:52 S05apt-cacher-ng -> 
../init.d/apt-cacher-ng
lrwxrwxrwx   1 root root    22 Jan  2 06:51 S05avahi-daemon -> 
../init.d/avahi-daemon
lrwxrwxrwx   1 root root    18 Jan  2 06:52 S05bootlogs -> ../init.d/bootlogs
lrwxrwxrwx   1 root root    26 Jan  2 06:51 S05clamav-freshclam -> 
../init.d/clamav-freshclam
lrwxrwxrwx   1 root root    23 Jan  2 06:51 S05clamav-milter -> 
../init.d/clamav-milter
lrwxrwxrwx   1 root root    22 Jan  2 06:51 S05cpufrequtils -> 
../init.d/cpufrequtils
lrwxrwxrwx   1 root root    14 Jan  2 06:51 S05cron -> ../init.d/cron
lrwxrwxrwx   1 root root    25 Jan  2 06:52 S05milter-greylist -> 
../init.d/milter-greylist
lrwxrwxrwx   1 root root    15 Jan  2 14:44 S05mysql -> ../init.d/mysql
lrwxrwxrwx   1 root root    27 Jan  2 06:53 S05nfs-kernel-server -> 
../init.d/nfs-kernel-server
lrwxrwxrwx   1 root root    15 Jan  2 06:51 S05rsync -> ../init.d/rsync
lrwxrwxrwx   1 root root    17 Jan  2 14:44 S06dovecot -> ../init.d/dovecot
lrwxrwxrwx   1 root root    18 Jan  2 06:51 S07rc.local -> ../init.d/rc.local


See how cron and mysql are on the same level? Its easy to imagine that another
system service "abc" relying upon mariadb is started *after* mariadb. If the
user's @reboot job tries to access abc, then there is a race condition.

To make sure that databases and other system services are run before the
@reboot cron jobs, you would have to add a ton of new dependencies to cron's
init script, and you could still not be sure about it.

Or you could specify that cron is started last at boot time, as version
3.0pl1-129 did. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767016#20

systemd has the same problem, AFAICT.


Regards
Harri

Reply via email to