How do I set up systemd service with systemd timer?

@rustybird

I removed user and group. Please give me one with two days to confirm that everything is fine.

Please tell me. I use debian over 10 years. All my systemd services and timers I put them in /etc/systemd/system/ without any problem.

Why qubes I have to put to /etc/systemd/user ? I repeat that the problem is that timer not save the settings oncalendar then when I reboot appvm or entire qube OS the service run again and again.

1 Like

@rustybird

Thank you very much, I am grateful for you.

  1. Can you explain me in previous question? Why do I have to put to /etc/systemd/user.

  2. In the future all my systemd service I have to put in the same directory?

1 Like

It’s a workaround for this bug (see there for technical details):

Only timers with Persistent=true, and the services that should be triggered by the timers. Until the bug is fixed.

1 Like

**@rustybird **

There is another bug in my question here.

Timer starts everyday at 7.00.pm , 14.00 and 21.00. If appvm has started the systemd timer not start when the time is 14.00 or 21.00. To fix that I have to shutdown Appvm then I start again the appvm.

Why?

I’m guessing the service is still considered active from being triggered by the 07:00 timer. Try removing RemainAfterExit=yes

Thank you rustybird.

Do you have any other solution excpet this? My script close librewolf browser then backup some files then load librewolf again.

RemainAfterExit=yes command can do this. If I removed this line librewolf not load again.

You might want to use KillMode=none instead of RemainAfterExit=yes

Thank you very much. It works.

I tried to put KillMode=: control-group, and mixed) because is safer from killMode=none
but It didn’t work. Killmode=none is unsafe.

Thank you again.