Bug 12011 - cronstamps directory is not created by dcron package
Summary: cronstamps directory is not created by dcron package
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2019.02.3
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-08 13:00 UTC by Dominique Tronche
Modified: 2024-06-15 14:50 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Tronche 2019-07-08 13:00:50 UTC
In package dcron makefile, the per-users directory /var/spool/cron/crontabs is created but not the timestamp directory /var/spool/cron/cronstamps.
As a consequence, the cron jobs from /etc/cron.hourly, /etc/cron.daily,... do not work

When crond is run manually we get the error message:
no timestamp found (user root job sys-hourly)
unable to write timestamp to /var/spool/cron/cronstamps/root.sys-hourly (user root job sys-hourly)
Comment 2 Zoltan Gyarmati 2019-07-10 10:57:00 UTC
It's back online, see:
https://github.com/dubiousjim/dcron/issues/21
Comment 3 Carlos Santos 2019-07-18 19:05:53 UTC
I'm taking this one.
Comment 4 Carlos Santos 2019-07-20 04:32:18 UTC
I identified two problems with dcron:

1. The installation creates the required directory /var/spool/cron/ but
   at run-time /var/spool is by default a symlink to /tmp, which by
   default is a tmpfs so the installed /var/spool/<foo> directories
   disappear. This can be solved in the init script as made in
   package/at/S99at but I'm not sure if it's a reasonable approach,
   since the directory contents will not persist between reboots.

2. The error messages that should be sent so the console on startup are
   not shown because crond is started with the "-f" argument via start-
   stop-daemon in order to create a PID file (see the explanation in
   commit 994e9fa72e80f8d618393619fefd68f65821144f). In order to solve
   this problem we must make dcron crate a PID file by itself and run
   in daemon mode, sending the error messages to syslog. Meanwhile we
   can just use pidof to PID file.
Comment 5 Carlos Santos 2019-07-20 18:41:46 UTC
Partial fix submitted: https://patchwork.ozlabs.org/patch/1134444/
Comment 6 Dominique Tronche 2019-07-22 09:07:28 UTC
On the subject of the link issue, in our project, we need to apply a patch to buildroot which replaces the symlinks to /tmp by real repositories in the skeletons
This patch is still needed despite 0c96bda11 (allow rootfs overlays to override symbolic links) since cron creates a /var/spool/cron directory. Since the rootfs_overlay is made after the make of dcron, /var/spool cannot not be a link in skeleton
If the /var/spool repositories were created by the S90dcron script, we would probably not need this patch anymore
Regards
Dominique Tronche
Comment 7 Carlos Santos 2019-07-22 11:11:22 UTC
(In reply to Dominique Tronche from comment #6)

As Yann clarified in his review of my patch,

"Getting a presistent storage, and customisations of the directory layout
to use those persistent locations, can not be done in a generic way. It
can only be handled locally, as each one will need to adapt to their own
constraints."

So I submitted a second patch with a better solution:

    https://patchwork.ozlabs.org/patch/1134631/
Comment 8 Yann E. MORIN 2024-06-15 14:50:07 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!