You are not logged in.

#1 2021-03-24 08:33:29

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 74

[SOLVED] systemd.preset – why are services not enabled?

It says here:

https://man.archlinux.org/man/systemd.preset.5

Example 1. Default to off

# /usr/lib/systemd/system-preset/99-default.preset
disable *

This disables all units. Due to the filename prefix "99-", it will be read last and hence can easily be overridden by spin or administrator preset policy.

Example 3. A GNOME spin

# /usr/lib/systemd/system-preset/50-gnome.preset
enable gdm.service
enable colord.service
enable accounts-daemon.service
enable avahi-daemon.*

This enables the three mentioned units, plus all avahi-daemon regardless of which unit type. A file like this could be useful for inclusion in a GNOME spin of a distribution. It will ensure that the units necessary for GNOME are properly enabled as they are installed. It leaves all other units untouched, and subject to other (later) preset files, for example like the one from the first example above.

Below are the contents of
/usr/lib/systemd/system-preset/50-zfs.preset

# ZFS is enabled by default
enable zfs-import-cache.service
disable zfs-import-scan.service
enable zfs-import.target
enable zfs-mount.service
enable zfs-share.service
enable zfs-zed.service
enable zfs-volume-wait.service
enable zfs.target

Question: Based on the above I would expect that all but one of the zfs services and targets would be enabled, yet that is not happening. Any ideas why? I have yet no pool defined but don't know if that is relevant.

systemctl list-unit-files | grep zfs    
zfs-import-cache.service                                                  disabled        enabled      
zfs-import-scan.service                                                   disabled        disabled     
zfs-import.service                                                        masked          disabled     
zfs-mount.service                                                         disabled        enabled      
zfs-share.service                                                         disabled        enabled      
zfs-volume-wait.service                                                   disabled        enabled      
zfs-zed.service                                                           disabled        enabled      
zfs-import.target                                                         disabled        enabled      
zfs-volumes.target                                                        disabled        disabled     
zfs.target                                                                disabled        enabled

Last edited by archdub (2021-03-24 18:54:09)

Offline

#2 2021-03-24 09:39:24

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,275
Website

Re: [SOLVED] systemd.preset – why are services not enabled?

man systemd.preset wrote:

systemctl preset is used by the post install scriptlets of RPM packages (or other OS package formats), to enable/disable specific units by default on package installation, enforcing distribution, spin or administrator preset policy.

Arch's /usr/share/libalpm/scripts/systemd-hook does not consider systemd presets.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2021-03-24 18:46:53

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 74

Re: [SOLVED] systemd.preset – why are services not enabled?

Thanks. That explains it.

I was thrown off track by the wiki, which seems to be outdated or wrong:
https://wiki.archlinux.org/index.php/Sy … by_default

Offline

Board footer

Powered by FluxBB