Nomad: Nomad hard links prevent cron from running

Created on 3 Aug 2016  路  5Comments  路  Source: hashicorp/nomad

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)
themclient typbug

All 5 comments

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

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings