I need to setup daily reboot of CoreOS machine. So I have /etc/systemd/system/reboot.service:

Description=Daily reboot

ExecStart=/usr/bin/sh -c 'reboot'

...and /etc/systemd/system/reboot.timer:

Description=Daily reboot

OnCalendar=*-*-* 21:20:00

If I activate timer by sudo systemctl start reboot.timer, I see it in the list:

core@node-011 ~ $ sudo systemctl list-timers --all | grep reboot
Fri 2019-03-22 21:20:00 UTC  12h left  n/a                          n/a      reboot.timer                 reboot.service
core@node-011 ~ $ 

But after reboot this timer became turned off (not in the list).

How to configure it persistent?


You activate SystemD units permanently with enable:

sudo systemctl enable reboot.timer

Note: start only starts them one time, and enable don't start them right away (only at next boot). You can combine both with the --now option:

sudo systemctl enable --now reboot.timer

will permanently activate the unit and starts it immediately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.