systemd / systemd/systemd

Applying default/distros presets override sysadmin previous configuration

Open
#4,830 44 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

install RFE 🎁
Dominant language
C
Stars
16.7k
Forks
4.7k
Avg merge
1d 6h
Merged PRs (30d)
140

Description

Hi,

This issue is not really new and there were some attempts to address it in the past already but unfortunately the work got lost somehow.

For example the latest work I found is the preset-transient one which is in my understanding about having symlinks created by the preset commands in /run/systemd/ thus having lower precedence than the symlinks created by the sysadmin in /etc/systemd/. However a part is still missing as disabling services should create null symlinks now in /etc/ and should override any corresponding symlinks directories with lower precedences.

There might another possibility though: basically when the user is enabling/disabling a service (via the EnableUnitFiles bus call), this operation would be recorded via a dedicated preset directive in a preset file located for example in /etc/systemd/system-preset/50-user-preferences.preset

For example if the user does systemctl enable foo.service, this operation would add "enable foo.service" in the dedicated preset file. A subsequent systemctl disable foo would replace the previous directive with "disable foo.service".

Since the preset file is located in /etc/systemd/systemd-preset, running systemd preset foo.service command would simply restore the user last preferences and would ignore the distro defaults as they are
now overridden.

However this wouldn't work if the sysadmin created the symlinks manually (using ln(1)) but in this case it might be acceptable to consider that creating symlinks in this way is considered as low-level operations and thus might be missing some functionalities (but of course its main purpose would still work).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EnableUnitFiles bus call and the systemd preset command, then review the preset-transient approach described in the issue and the precedence between /run/systemd/ and /etc/systemd/. Done requires a decided approach that preserves sysadmin preferences over distribution presets and defines the behavior of enable, disable, and subsequent preset operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.