All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Trouble with cron / crontab
@ 2015-03-20 11:20 Fabrice Mousset | GEOCEPT GmbH
  2015-03-20 12:31 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Mousset | GEOCEPT GmbH @ 2015-03-20 11:20 UTC (permalink / raw)
  To: buildroot

Hi all,

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?

Kind regards

Fabrice Mousset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150320/2d915306/attachment.html>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Trouble with cron / crontab
  2015-03-20 11:20 [Buildroot] Trouble with cron / crontab Fabrice Mousset | GEOCEPT GmbH
@ 2015-03-20 12:31 ` Thomas Petazzoni
  2015-03-20 13:02   ` Fabrice Mousset | GEOCEPT GmbH
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2015-03-20 12:31 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Trouble with cron / crontab
  2015-03-20 12:31 ` Thomas Petazzoni
@ 2015-03-20 13:02   ` Fabrice Mousset | GEOCEPT GmbH
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Mousset | GEOCEPT GmbH @ 2015-03-20 13:02 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

> Von: Thomas Petazzoni [mailto:thomas.petazzoni at free-electrons.com]
> 
> 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
> --

Thank you for your help, indeed I found that /tmp/spool is an symlink. So I started to write an initscript (/etc/init.d/S99crontab) to create symlink from  /etc/crontab.d to /var/spool/crontab
So my cron jobs definitions will be stored in /etc/crontab.d/, I don't know if it is a good idea, but it is easy to setup ;-)

Best regards,

Fabrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-20 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 11:20 [Buildroot] Trouble with cron / crontab Fabrice Mousset | GEOCEPT GmbH
2015-03-20 12:31 ` Thomas Petazzoni
2015-03-20 13:02   ` Fabrice Mousset | GEOCEPT GmbH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.