Your message dated Tue, 10 May 2022 15:06:08 +0200
with message-id <[email protected]>
and subject line Closing the bug report
has caused the Debian Bug report #918028,
regarding user's @reboot cron job might be run before the system services have
been initialized
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
918028: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918028
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Dear Harald,
the first bug report states that crond is not launched as the last
daemon, when sysv init is used.
If we start a new debian system now, all services to be started in
/etc/rc*.d are prefixed with S01. For example, /etc/rc5.d/S01cron is
used to launch crond, which will be run before other service occurring
in alphanumeric order, like /etc/rc5.d/S01mariadb for instance.
The package cron provides /etc/init.d/cron, and no post-installation
process is provided to populate /etc/rc*.d directories, neither to
reorganize them.
So, I fear that the best solution to this particular issue, would be to
rename manually the file /etc/rc5.d/S01cron to someting like
/etc/rc5.d/S99cron yourself, or to find people wanting to maintain sysv
init scripts, and able to implement your wishes.
----
In your second post to this same bug report, you noticed that
--------------8<------------------------
I just had the case that cron ran a user's @reboot job, even
though his $HOME wasn't mounted via NFS yet.
init was systemd.
--------------8<------------------------
The current version of cron provides the file cron-service which
features this particular line for the boot sequence:
After=remote-fs.target nss-user-lookup.target
So, if systemd does its job properly, a home directory mounted via NFS
is mounted *before* crond can make anything related to the home's owner.
I close the bug report now. Feel free to reopen it if something is
wrong.
Best regards, Georges.
--
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70
signature.asc
Description: PGP signature
--- End Message ---