4

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

[Unit]
Description=Daily reboot

[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c 'reboot'

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

[Unit]
Description=Daily reboot

[Timer]
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?

4

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.

| improve this answer | |

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.