You are not logged in.
Pages: 1
Hello,
I try to set up a simple systemd timer as user. My configuration so far is:
florian@horus-mac ~ % cat .config/systemd/user/helium-sync.timer
[Unit]
Description=Timer to sync home with helium
[Timer]
OnUnitActiveSec=2min
florian@horus-mac ~ % cat .config/systemd/user/helium-sync.service
[Unit]
Description=Sync home with helium
[Service]
Nice=10
ExecStart=/home/florian/software/bin/helium-sync.sh
helium-sync.sh at this time is just a simple script putting a timestamp in my ~. This is exactly also what "systemctl --user start helium-sync" does, the service seems to work. But the timer never fires:
florian@horus-mac ~ % systemctl --user status helium-sync.timer
● helium-sync.timer - Timer to sync home with helium
Loaded: loaded (/home/florian/.config/systemd/user/helium-sync.timer; static)
Active: active (elapsed) since Mi 2014-04-02 10:15:13 CEST; 21min ago
Apr 02 10:15:13 horus-mac systemd[256]: Starting Timer to sync home with helium.
Apr 02 10:15:13 horus-mac systemd[256]: Started Timer to sync home with helium.
florian@horus-mac ~ % systemctl --user status helium-sync.service
● helium-sync.service - Sync home with helium
Loaded: loaded (/home/florian/.config/systemd/user/helium-sync.service; static)
Active: inactive (dead)
I also tried added an explicit "Unit=helium-sync.service" to the [Timer] section. (which should according to the docs unecessary, since .timer and .service file have the same name)
Anyone know what could be wrong here?
Thanks!
Offline
Look further at the journal (journalctl -b --user). It says that the timer elapsed, so the service should have run.
Offline
Negative, nothing but
Apr 02 12:15:32 horus-mac systemd[256]: Starting Timer to sync home with helium.
Apr 02 12:15:32 horus-mac systemd[256]: Started Timer to sync home with helium.
Offline
Negative, nothing but
Apr 02 12:15:32 horus-mac systemd[256]: Starting Timer to sync home with helium. Apr 02 12:15:32 horus-mac systemd[256]: Started Timer to sync home with helium.
You rebooted? Because in your first post the time was 10:15. And you're only using OnUnitActiveSec, which defines a timer relative to when the corresponding service was last activated, so it's not going to start on its own. You said the script worked when manually starting the service. At that point the service is activated, so I would expect the timer to be triggered 2 minutes later (and again 2 minutes later etc.). But if the service unit is never activated (after a reboot) the timer shouldn't do anything. To change that you would add OnBootSec or OnStartupSec.
Offline
Ok, I didn't know that OnUnitActiveSec never activates the unit itself for the first time. I added OnActiveSec=2min, know it works.
Apr 02 13:29:14 horus-mac systemd[256]: Starting -.slice.
Apr 02 13:29:14 horus-mac systemd[256]: Created slice -.slice.
Apr 02 13:29:14 horus-mac systemd[256]: Starting Sync home with helium...
Apr 02 13:29:14 horus-mac systemd[256]: Started Sync home with helium.
and also:
[Install]
WantedBy=default.target
for enabling.
Thanks!
Offline
Pages: 1