[Buildroot] Trouble with cron / crontab

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Mar 20 12:31:37 UTC 2015


Hello,

On Fri, 20 Mar 2015 11:20:36 +0000, Fabrice Mousset | GEOCEPT GmbH
wrote:

> I am facing a strange issue with Buildroot 2015.02. I am using cron/crontab from Busybox but can't start/define any cronjob because /var/spool/cron/crontabs didn't exist on my rootfs.
> On my rootfs there is no /var/spool/cron but this exist on output/target.
> 
> I haven't found anything in documentation about cron...
> Is there something I have missed?

In the skeleton:

$ ls -l system/skeleton/var/
total 4
lrwxrwxrwx 1 thomas thomas    6 mars   8  2014 cache -> ../tmp
drwxr-xr-x 2 thomas thomas 4096 mars   5 15:40 lib
lrwxrwxrwx 1 thomas thomas    6 mars   8  2014 lock -> ../tmp
lrwxrwxrwx 1 thomas thomas    6 mars   8  2014 log -> ../tmp
lrwxrwxrwx 1 thomas thomas    7 mars  17 15:28 run -> ../run/
lrwxrwxrwx 1 thomas thomas    6 mars   8  2014 spool -> ../tmp
lrwxrwxrwx 1 thomas thomas    6 mars   8  2014 tmp -> ../tmp

So /var/spool is a symbolic link to /tmp, which means it resides on
tmpfs. You could change the cron init script to create /var/spool/cron
at boot time, but I guess it wouldn't be very useful as you would lose
your cronjob definitions at each reboot I believe.

So maybe we need to change the default Busybox configuration to store
the crontab somewhere or re-think /var/spool as being in tmpfs.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list