OS 13.1 - Systemd/user timer and timer service install - how to stop it when user logoff

The timer is start in ~/.profile :

    systemctl --user start user_timer.timer

What keyword I must use to stop it when user logoff.
Here is my systemd/user timer.

# Directory   : ~/.config/systemd/user
# file        : user_timer.service
# enable with : systemctl --user  enable  user_timer.service

ExecStart=~/bin/user_script_tmr  ${TEXT} ${A_USER}

I don’t know the exact attribute flags which may be required/desirable, but you’re looking for how to configure the ExecStop command in your Unitfile. Maybe a search for how your timer is used with this command as your keywords should turn something up.

Also, if you know how to execute from the command line it might be a start, so for example inspect what is in your “~/bin/user_script_tmr”

If you can identify the binary start command in that script, it’ll probably provide a strong hint what the command might be to stop the binary app, and then after some testing you’d insert as an “ExecStop” command.


I restated my question otherwise: is it necessary to stop a systemd user service for a specific user because of that user logoff or does it stops by itself (because that user logoff) ?

Any help is welcome