You are not logged in.

#1 2021-05-04 11:10:36

Registered: 2017-11-23
Posts: 234

[Systemd] Manage service to kill itself at event

Hi everyone,

I am fighting a little with systemd and finally got a working unit service. This is a user unit under ~/.config/systemd/user/mem.service meaning to regularly update the memory information in my i3 status bar.

Description=Memory bar display

ExecStart=%h/.pyenv/shims/python %h/dev/python/bar_display/


I observed that the service doesn't get killed when I kill i3 and the Xorg server. I then understand that the After and Requires parameters are dependencies only for the start process but not for the running.
This process only makes sens when i3 is started, how can I tell systemd to finish this process when i3 is killed ? Should I run i3 as a systemd service to ?

Less importantly, how can I create a folder in ~/.config/systemd/user/ to put this particular service unit and still be able to start it with systemctl --user start mem.service ?

Is my general way to do good ?

Thanks for your time.

all different - all equal


Board footer

Powered by FluxBB