I am trying to start a systemd user service at user login. But my service keep starting at boot and remain running after I logout. I am on Linux Mint 21.2. Here is what I did so far.
- Create unit file in
/usr/lib/systemd/user/mpd.servicewith following content
[Unit] Description=Music Player Daemon[Service] ExecStart=/usr/bin/mpd --no-daemon
[Install] WantedBy=default.target
- Enable with
sudo systemctl --global enable mpd.service - Reload daemon
systemctl --user daemon-reload - Logout and log back in. Nothing started.
- Reboot and the service started. After I logout, the service still keep running.
There is a similar question here. But I don't get the behavior described in the answers there.