I want to start the cron daemon every time I reboot HA OS.
I created an automation to run every time Home Assistant is started. It works great, I can see that crond is running in the process status list as my automation completes. “trace” log below.
Unfortunately, by the time HA is fully restarted,the environment for my cron daemon is gone.
I’ve had similar results using startup.d
…my crond startup script works, but the “container” (I’ve tried them all) is gone by the time HA is fully functional. For now I manually run my crond startup script after every HA OS reboot. Is there a “right” way to do this sort of thing? [I do use the hassio shell command and time trigger automation for a few things, but crond provides a more compact script callout for some repetitive services.]
My HA-start event trace log:
Copy crontab to /etc/crontabs/root
Call startcron
Start crond
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 9-15 * * * /root/share/TL-cams
15 7,19 * * * /root/share/OneShot
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 9-15 * * * /root/share/TL-cams
15 7,19 * * * /root/share/OneShot
PID USER TIME COMMAND
1 root 0:00 s6-svscan -t0 /var/run/s6/services
36 root 0:00 s6-supervise s6-fdholderd
185 root 0:00 s6-supervise home-assistant
188 root 0:17 python3 -m homeassistant --config /config
228 root 0:00 {cronrepair} /bin/sh /config/myscripts/cronrepair
231 root 0:00 {startcron} /bin/sh /config/myscripts/startcron
235 root 0:00 /usr/sbin/crond -S -l 0
238 root 0:00 ps -e
Wed Jan 5 11:30:34 EST 2022