Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#24293 - Cronie doesn't execute jobs after PC restart

Attached to Project: Arch Linux
Opened by Clouseau2 (Clouseau2) - Sunday, 15 May 2011, 18:40 GMT
Last edited by Gaetan Bisson (vesath) - Monday, 16 May 2011, 17:49 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

As described here https://bbs.archlinux.org/viewtopic.php?id=118921 Cronie ignores crontab -e after restart of computer. If I reenter through "crontab -e" the same options and restart crond daemon it works. But if I restart computer it doesn't work anymore until I repeat "crontab -e" and restart crond daemon. Also it doesnt work with the same options in /etc/cron.d/ directory...

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

1) add script in /etc/cron.d/ or via crontab -e in example 30 20 * * * /usr/local/bin/test
2) restart crond daemon and afterwards restart computer
3)the "test" is NOT executed at 20:30
This task depends upon

Closed by  Gaetan Bisson (vesath)
Monday, 16 May 2011, 17:49 GMT
Reason for closing:  Works for me
Comment by Ionut Biru (wonder) - Sunday, 15 May 2011, 18:42 GMT
do you really have crond in daemons?
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 07:27 GMT
Yes, it is stated in the rc.conf and it is started on boot. If I replace it with dcron everything works. My hwclock is set to UTC but it is turned of in daemons because I use NTP. If I enable hwclock in daemons (it must be put on the first place in array) then cronie works. Very odd. Dcron works "out of the box"...
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 07:37 GMT
I can confirm this on another computer at work which is a fresh install of arch...

hwclock is set tu UTC:

hwclock -rD
Time read from Hardware Clock: 2011/05/16 07:36:36
Hw clock time : 2011/05/16 07:36:36 = 1305531396 seconds since 1969
Pon 16 Svi 2011 09:36:36 -0.532015 seconds

date -u
Pon Svi 16 07:36:53 UTC 2011

date
Pon Svi 16 09:37:13 CEST 2011

Clocks are set right.
Comment by Gaetan Bisson (vesath) - Monday, 16 May 2011, 09:31 GMT
Could you describe your system and its specificities in a little bit more detail?
Obviously, cron jobs still work for most of us that switched to cronie...

- Did you change anything related to the configuration of cronie?
- Had you changed anything related to the configuration of dcron?
- Please paste the output of `ls -la /var/spool/cron`
- Please paste the output of `cat /etc/conf.d/crond`
- Just after you reboot your computer, does `ps auxw | grep crond` output anything?
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 10:48 GMT
Ok, I've "managed" to get it work at PC at work. I have removed cronie and installed dcron. And it works. And then I have removed dcron and installed Cronie and now it works! Really don't get it. I have network, ntpd, crond daemon on a pc on work and no hwclock in daemons. I haven't changed anything related to dcron or cronie configurations. ps aux states /usr/sbin/crond. I put merely a "crontab -e" entry and also tried with the same entry in /etc/cron.d.

At home were the problem persists I have networkmanager, ntpd and no hwclock. The network is established through "kde-plasma-networkmanager". Is Cronie senstive to ntpd? Will test it at home and will post back if I managed to get it work...

Also the entry in "crontab -e" is in this format:
"20 6 * * * /usr/local/bin/test"

but the entry in /etc/cron.d/something must be given explicitly a user also to get it work:
"20 6 * * * root /usr/local/bin/test"


ls -la /var/spool/cron/
-rw------- 1 root root 0 Svi 16 12:04 root

cat /etc/conf.d/crond
# Settings for the CRON daemon.
# CRONDARGS= : any extra command-line startup arguments for crond
CRONDARGS=
Comment by Gaetan Bisson (vesath) - Monday, 16 May 2011, 11:24 GMT
Your `ls -la /var/spool/cron/` indicates that the cron file is empty.
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 11:33 GMT
There is a file "root" in that directory which is empty only when I add a file in /etc/cron.d/ and not use crontab -e. If I add entry through crontab -e than it has:

cat /var/spool/cron/root
00 22 * * * /usr/local/bin/rsyncbackup.sh
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 11:47 GMT
I will test more at pc at home, at pc at work cronie works. Will report back.
Comment by Clouseau2 (Clouseau2) - Monday, 16 May 2011, 17:37 GMT
Ok, for two days I couldn't get it to work and after I post a bug on tracker it started to work. Very odd, like I'm on Windows or something :)) Really didn't do anything except I restarted PC a couple of times when testing crontab -e... Maybe my system time was adjusted by hwclock which was presented in localtime but was in UTC. So I run this "hwclock --utc --hctosys" yesterday and maybe that was the trigger to get cronie to work. I cannot tell 100% cause I've played with couple of things simultanously. Although dcron had no problem with that and worked perfect... Sorry for your time guys and thank you, this can be closed now cronie works!
Comment by Gaetan Bisson (vesath) - Monday, 16 May 2011, 17:49 GMT
Good to hear! :)

Loading...