Таймаут вернул 124, а следующий запуск пропущен: какие фоновые утилиты держат flock
A cron job ran into its timeout and logged exit code 124, and the next scheduled run was silently skipped because the lock was still held. To see what keeps a background process alive, the author tested seven common ways of leaving something running in the background inside a container — setsid -f, nohup, start-stop-daemon, a double fork, ssh-agent and gpg-agent — under timeout and subprocess.run(timeout=). None of the wrappers killed the daemon. Whether cron skips the following run depends on the utility itself: gpg-agent holds the lock, while ssh-agent releases it.
Задача в cron упёрлась в timeout, в логе код 124, а следующий запуск молча пропускается: lock занят. Я проверил в контейнере семь обычных способов оставить что-то работать в фоне — setsid -f, nohup, start-stop-daemon, двойной fork, ssh-agent, gpg-agent — под timeout и subprocess.run(timeout=). Демона не убила ни одна обёртка. Пропустит ли cron следующий запуск, решает сама утилита: gpg-agent держит lock, ssh-agent отпускает, но за пять запусков копится пять агентов. Код 124 у оборванного запуска при этом одинаковый. Читать далее