Systemd/timers: Difference between revisions

Added `RemainAfterExit = true;` to the example since this is probably what people want.
https://man.archlinux.org/man/systemd.timer.5.en "services with RemainAfterExit=yes set (which stay around continuously even after the service's main process exited) are usually not suitable for activation via repetitive timers, as they will only be activated once, and then stay around forever."
Tags: Manual revert Visual edit
 
Line 35: Line 35:
     Type = "oneshot";
     Type = "oneshot";
     User = "root";
     User = "root";
    RemainAfterExit = true; # Prevents the service from automatically starting on rebuild. See https://discourse.nixos.org/t/how-to-prevent-custom-systemd-service-from-restarting-on-nixos-rebuild-switch/43431
   };
   };
};
};