[systemd-devel] user service conflict and confusion

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Apr 10 18:04:05 UTC 2020


On Fri, Apr 10, 2020 at 10:53:36AM -0500, Matt Zagrabelny wrote:
> Greetings,
> 
> I am hitting a confusing scenario with my system. I am running 245.4-2
> (Debian).
> 
> I have a user service, mpd, which is failing to start. It is enabled:
> 
> $ systemctl --user is-enabled mpd
> enabled
> 
> And now that I look for the enabled unit within the filesystem, I don't see
> it.
> 
> I'm expecting to see something in ~/.config/systemd, but that directory
> doesn't exist.
> 
> $ stat ~/.config/systemd
> stat: cannot stat '/home/z/.config/systemd': No such file or directory
> 
> I have other systems with user services and ~/.config/systemd is where all
> the details are.
> 
> First question, where should I be looking (in the filesystem) for user
> enabled services?

Try 'systemctl --user cat mpd'.

> After that I look to see why the user service isn't starting:
> 
> $ systemctl --user status mpd
> [...]
> Apr 10 10:00:29 zipper mpd[16231]: exception: Failed to bind to '
> 192.168.0.254:6600'
> Apr 10 10:00:29 zipper mpd[16231]: exception: nested: Failed to bind
> socket: Address already in use
> Apr 10 10:00:29 zipper systemd[1982]: mpd.service: Main process exited,
> code=exited, status=1/FAILURE
> 
> Okay. Something is using that port.
> 
> $ sudo fuser 6600/tcp
> 6600/tcp:             1795
> 
> $ ps -f -q 1795
> UID          PID    PPID  C STIME TTY          TIME CMD
> root        1795       1  0 08:24 ?        00:00:00 /lib/systemd/systemd
> --user
> 
> Is that "systemd --user" command running for the root user? or is that the
> system level systemd?
> 
> My system level mpd.* units are disabled and inactive:
> 
> # systemctl is-active mpd.service
> inactive
> 
> # systemctl is-active mpd.socket
> inactive

Maybe it's running under user at 0.service, i.e. the root's user manager?
You can drill down from 'systemctl status 1795'.

Zbyszek


More information about the systemd-devel mailing list