Re: masking --global, but allowing --user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 17, 2021 at 07:02:14PM -0500, Matt Zagrabelny wrote:
> Greetings,
> 
> I believe the Debian package of mpd enables a --global .service and
> .socket unit for the mpd daemon/service.
> 
> I'd like to mask that and install it just to a single --user service.
> 
> I've tried that:
> 
> sudo systemctl --global mask mpd.service
> sudo systemctl --global mask mpd.socket
> 
> and then:
> 
> systemctl --user enable mpd
> Failed to enable unit: Unit file /etc/xdg/systemd/user/mpd.service is
> masked.
> The reason I do not like the --global version is due to logging in on
> a virtual console as root and then mpd starting up and causing issues
> with the preferred service running under my main user account.
> 
> Any idea how to solve my problem?

PipeWire and PulseAudio use the following guard on both the socket and
the service:

[Unit]
ConditionUser=!root

This snippet can be put in a override file for mpd's unit either by
hand, or by means of "systemctl --global edit".

It might make sense to suggest this upstream.

> Thanks for any help!
> 
> -m

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux