systemd / systemd/systemd

`systemctl reenable` does not handle template unit files very well

Open
#11,015 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.

systemctl reenable does not handle template unit files very well. Say I have foobar@.service installed in /usr/lib/systemd/system, and then I've run systemctl enable foobar@a and systemctl enable foobar@b.

Now say I want to override foobar@.service in /etc, so I create /etc/systemd/system/foobar@.service and run systemctl reenable foobar@, to update symlinks. Intuitively I would expect systemd to either error out and make me list foobar@a and foobar@b individually, or to reenable both template instances.

However, instead of doing that, systemctl notes that it's removing the symlinks for the template file instantiations, and installing a new plain pump.io@.service symlink in /etc/systemd/system/multi-user.target.wants.

Describe the solution you'd like

Template instantiations should be reenabled in a manner similar to what you'd expect.

Describe alternatives you've considered

As I mentioned above, systemd could also just error out in this situation? Honestly I don't understand template unit files, etc. enough to know what the right solution here is. It might also involve a completely separate command to update symlink locations.

System information

I'm on Fedora 28, which reports systemd 238.

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

Reproduce the behavior with the template unit and systemctl enable/reenable commands described in the issue, then trace how systemctl handles reenable for template instances. Done should be either correct reenable behavior for all enabled instances or a clear error explaining that instances must be listed individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.