[systemd-devel] user service conflict and confusion

Matt Zagrabelny mzagrabe at d.umn.edu
Fri Apr 10 18:41:59 UTC 2020


On Fri, Apr 10, 2020 at 1:32 PM Zbigniew Jędrzejewski-Szmek <
zbyszek at in.waw.pl> wrote:

> 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'.
>

Sure. I was talking about the symlink for enabling it, but thanks anyhow!
Michael answered it.

Is there a --is-global switch to see if a --user enabled service is enabled
at the global level?



>
> > 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?
>

Indeed! I'd forgotten that I logged in (as root) while lightdm was starting.


> You can drill down from 'systemctl status 1795'.
>

Cool!

Thanks for the help!

-m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200410/fbf21c92/attachment.htm>


More information about the systemd-devel mailing list