Bug 19233

Summary: cronie-anacron does not start hourly jobs located in /etc/cron.hourly
Product: Mageia Reporter: Chris Denice <eatdirt>
Component: RPM PackagesAssignee: Shlomi Fish <shlomif>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Normal CC: marja11
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: cronie-1.5.1-1.mga6.src.rpm CVE:
Status comment:

Description Chris Denice 2016-08-22 18:45:58 CEST
Description of problem:

I would have expected jobs put in /etc/cron.hourly to be run by cronie-anacron, but that's not the case, they are all ignored for yet to be found reasons.

Cheers,
Chris.

PS: if confirmed, it may be security issue.
Comment 1 Marja Van Waes 2016-08-22 19:31:47 CEST
Assigning to maintainer.

(Can't check whether I have the same issue here, now, because I'm behind on updates on this system)

CC: (none) => marja11
Assignee: bugsquad => shlomif

Comment 2 Chris Denice 2016-08-23 11:56:25 CEST
Ok, the bug is not in cronie-anacron itself, but really in "cronie".
Anacron does not support less than a day "crontab", so this is not a bug of anacron, just a weird feature poorly documented.

However, cronie, through crond.service, should read /etc/crontab (which looks fine) and should therefore enter /etc/cron.hourly and starts hourly jobs. However, it does not on my machine. That's indeed a security issue because we have "msec" in /etc/cron.hourly, which is therefore not executed!!
Comment 3 Shlomi Fish 2016-08-23 11:58:00 CEST
(In reply to Marja van Waes from comment #1)
> Assigning to maintainer.
> 
> (Can't check whether I have the same issue here, now, because I'm behind on
> updates on this system)

I'm trying to reproduce it here.
Comment 4 Shlomi Fish 2016-08-23 13:22:49 CEST
(In reply to Shlomi Fish from comment #3)
> (In reply to Marja van Waes from comment #1)
> > Assigning to maintainer.
> > 
> > (Can't check whether I have the same issue here, now, because I'm behind on
> > updates on this system)
> 
> I'm trying to reproduce it here.

I am unable to reproduce the problem on my Mageia v6 x86-64 system:

«
root@telaviv1:~$ cat /etc/cron.hourly/01cron-test-to-del 
#!/bin/bash
echo "From cron.hourly cron test to del - $(date)" >> /var/tmp/cron-hourly-test.txt
root@telaviv1:~$ cat /var/tmp/cron-hourly-test.txt 
From cron.hourly cron test to del - Tue Aug 23 13:01:01 IDT 2016
From cron.hourly cron test to del - Tue Aug 23 14:01:01 IDT 2016
root@telaviv1:~$ 
»

So it seems to be working perfectly fine here. Does it still happen after you restart crond? ("service crond restart") Do any of the files have local modifications?
Comment 5 Chris Denice 2016-08-24 13:58:58 CEST
Thanks for testing. No, I don't think so. Maybe it is a missing dep ?
Could you tell me if these packages are installed:

cronie
cronie-anacron
crontabs
fcron
incron
kcron
kcron-handbook
man-db-cron
packagekit-cron

then I could try to search for what is wrong with my installation!?
Comment 6 Shlomi Fish 2016-08-24 16:21:20 CEST
(In reply to Chris Denice from comment #5)
> Thanks for testing. No, I don't think so. Maybe it is a missing dep ?
> Could you tell me if these packages are installed:
> 
> cronie
> cronie-anacron
> crontabs
> fcron
> incron
> kcron
> kcron-handbook
> man-db-cron
> packagekit-cron
> 

root@telaviv1:~$ rpm -q cronie
cronie-1.5.1-1.mga6
root@telaviv1:~$ rpm -q cronie-anacron
cronie-anacron-1.5.1-1.mga6
root@telaviv1:~$ rpm -q crontabs
crontabs-1.10-22.mga6
root@telaviv1:~$ rpm -q fcron
package fcron is not installed
root@telaviv1:~$ rpm -q incron
package incron is not installed
root@telaviv1:~$ rpm -q kcron
package kcron is not installed
root@telaviv1:~$ rpm -q kcron-handbook
package kcron-handbook is not installed
root@telaviv1:~$ rpm -q man-db-cron
package man-db-cron is not installed
root@telaviv1:~$ rpm -q packagekit-cron
package packagekit-cron is not installed
root@telaviv1:~$ 

> then I could try to search for what is wrong with my installation!?

Regards,

-- Shlomi
Comment 7 Chris Denice 2016-08-25 11:17:19 CEST
Sorry for the noise, that works.
I had an issue with the jobs itself which was needed root shell variables to be set (fixed with a su root -c).

Thanks!!

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Comment 8 Shlomi Fish 2016-08-25 15:40:58 CEST
Thanks for the update, Chris! I'm glad it is working for you.