Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nomad hard links prevent cron from running #1507

Open
jshaw86 opened this issue Aug 3, 2016 · 6 comments
Open

Nomad hard links prevent cron from running #1507

jshaw86 opened this issue Aug 3, 2016 · 6 comments

Comments

@jshaw86
Copy link

jshaw86 commented Aug 3, 2016

Nomad version

Output from nomad version
nomad 0.4.0

Operating system and Environment details

ubuntu 14.04

Issue

Nomad prevents cron from running after creating chroot.

Reproduction steps

  1. create a chroot (via exec)
  2. run a cron
  3. observe that cron does not run

Nomad Client logs (if appropriate)

From syslog:

Jul 29 23:03:01 nomad-agent1 cron[1043]: (*system*) NUMBER OF HARD LINKS > 1 (/etc/crontab)
Jul 29 23:03:01 nomad-agent1 cron[1043]: (*system*ansible-pull) NUMBER OF HARD LINKS > 1 (/etc/cron.d/ansible-pull)
@dadgar
Copy link
Contributor

dadgar commented Aug 3, 2016

Are you trying to set up a cron inside the task's chroot? There is no cron daemon running so that will not work

@jshaw86
Copy link
Author

jshaw86 commented Aug 3, 2016

@dadgar no just in the "global" root or whatever you want to call it

@tantra35
Copy link
Contributor

tantra35 commented Aug 3, 2016

This can be due hardlinking of /etc/crontab and /etc/cron.d/* which nomad do when make chroot enviroment, for those files nomad must make copy but not hardlink, and issue will be resolved

@mac-abdon
Copy link

Here is the CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-1856

@nferch
Copy link

nferch commented Jan 25, 2020

Any updates or recent experiences with this one? It is possible to work around the issue by specifying chroot_env but it's rather cumbersome and error prone as you need to guess and include what bits of /etc need to be included. Perhaps there could be something like a chroot_env_exclude but that seems a bit kludgy as well.

@tgross tgross added this to Needs Roadmapping in Nomad - Community Issues Triage Feb 12, 2021
@tgross tgross added the stage/needs-verification Issue needs verifying it still exists label Mar 3, 2021
@tgross tgross removed this from Needs Roadmapping in Nomad - Community Issues Triage Mar 3, 2021
@MikeN123
Copy link
Contributor

Some additional information/verification. I think this is at least an issue on all Debian-based distros. One of the maintainers for the Debian cron package here mentions the check for hard links cannot be disabled: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647193

So Nomad needs to exclude these files somehow. The user can do that by setting the chroot_env, but that's quite cumbersome and I also think a vanilla Nomad install probably does not want to break the host cron. Seems to make sense to have a list of files to exclude from chroot_env, and setting the exclude to /etc/crontab and /etc/cron.d by default.

@tgross tgross added this to Needs Triage in Nomad - Community Issues Triage via automation Nov 18, 2022
@tgross tgross moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-verification Issue needs verifying it still exists theme/client type/bug
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

7 participants