Discussion:
Disabling package-managed user units
(too old to reply)
Evan Klitzke
2018-05-14 22:29:14 UTC
Permalink
Raw Message
I'm already familiar with how systemd user services for units in
~/.config/systemd/user work. I recently learned about package managed
user units, which on Fedora are unit files installed by RPMs to
/usr/lib/systemd/user.

Is it possible to disable these units? When I use "systemctl --user
disable foo.socket" the package-managed user foo.socket I disabled seems
to still be enabled when I log in.

--
Evan Klitzke pgp: 0x157EFCACBC648422
e: ***@eklitzke.org w: https://eklitzke.org
Reindl Harald
2018-05-14 22:56:21 UTC
Permalink
Raw Message
https://wiki.archlinux.org/index.php/Systemd/User

Similarly to system units, user units are located in the following
directories (ordered by ascending precedence):

/usr/lib/systemd/user/ where units provided by installed packages
/etc/systemd/user/ where system-wide user units are placed by the system
administrator

educated guess: since enable/disable is just a wish in general, use
"mask" instead "disable" which pretty sure leads to symlink
/etc/systemd/user/servicename.service to /den/null or just place a
identuical named symlink to /dev/null there

Am 15.05.2018 um 00:29 schrieb Evan Klitzke:
>
> I'm already familiar with how systemd user services for units in
> ~/.config/systemd/user work. I recently learned about package managed
> user units, which on Fedora are unit files installed by RPMs to
> /usr/lib/systemd/user.
>
> Is it possible to disable these units? When I use "systemctl --user
> disable foo.socket" the package-managed user foo.socket I disabled seems
> to still be enabled when I log in
Evan Klitzke
2018-05-15 01:17:09 UTC
Permalink
Raw Message
Reindl Harald <***@thelounge.net> writes:

> educated guess: since enable/disable is just a wish in general, use
> "mask" instead "disable" which pretty sure leads to symlink
> /etc/systemd/user/servicename.service to /den/null or just place a
> identuical named symlink to /dev/null there

Indeed, "systemctl --user mask" creates a symlink to /dev/null which is
effective at preventing the unit from starting when I log in. Thanks, I
wasn't aware of the "mask" command.

--
Evan Klitzke pgp: 0x157EFCACBC648422
e: ***@eklitzke.org w: https://eklitzke.org
Andrei Borzenkov
2018-05-15 04:34:51 UTC
Permalink
Raw Message
15.05.2018 01:29, Evan Klitzke пишет:
>
> I'm already familiar with how systemd user services for units in
> ~/.config/systemd/user work. I recently learned about package managed
> user units, which on Fedora are unit files installed by RPMs to
> /usr/lib/systemd/user.
>
> Is it possible to disable these units?

Not really. There was a long discussion about it but I do not think
anything was done at the end.

As mentioned you can mask them, but note that it is rather more heavy
weighted - it makes it impossible to start these units even manually.
Loading...