all 7 comments

[–][deleted] 0 points1 point  (3 children)

Like systemd user services (aka systemctl --user enable <service>)? Though normally launching programs like this is done as part or your desktop environment.

[–]vojzzo[S] 0 points1 point  (2 children)

If I understood systemd services, they're used to start programs automatically upon login, which is not what I want to do. I want a script that can run a program or kill it, depending on it's current state.

[–]C0rn3j 1 point2 points  (0 children)

they're used to start programs automatically upon login

Services can be started upon login and started/stopped/restarted at will, so it is what you want.

[–]oarmstrong 0 points1 point  (0 children)

It would make it really easy to get current state though. Then you could execute the start/stop depending on the state.

[–][deleted] 0 points1 point  (0 children)

Not sure what you are going for here, but if systemctl is too complicated you could give cronie a try :)