Show proper error message when syntax in 'RequiredBy=' is wrong
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- linux
- Domain
- operating-systems
Research direction
Reproduce the issue with the provided .service file and systemd-analyze verify automount.service, focusing on dependency handling for the [Unit] section's Before= entry. Done means the invalid pve-guests dependency produces a specific diagnostic rather than Unknown error -22, or that the documented extension behavior is clarified.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
In a .service file under the [Unit] section when using the 'Before=' option and forgetting to specify the '.service' ending for services listed there, an 'Unknown Error 22' is thrown when analyzing the service file or using the service.
My specific example
[Unit]
Description=Automount Encrypted Dataset
Before=pve-guests
[Service]
Type=simple
ExecStartPre=/bin/true
ExecStart=/bin/true
[Install]
WantedBy=multi-user.target
When booting the system with this service enabled or analyzing the file via "systemd-analyze verify automount.service" the following unspecific error appears.
Failed to add dependency on pve-guests, ignoring: Unknown error -22
Took me quite some time to find my mistake since the error message is not very specific about the problem.
Describe the solution you'd like
In case this is a syntax error in systemd, the file should not be possible to load. In case this syntax is allowed but a unit with this name could not be found, the error should be something like:
Failed to add dependency on pve-guests, ignoring: Error: Unit pve-guests doesn't exist
Describe alternatives you've considered
Automatically assume '.service' extension when user didn't specify an extension.
- Dominant language
- C
- Stars
- 16.7k
- Forks
- 4.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 140
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from systemd/systemd
-
bug 🐛 documentation release-critical
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
systemd-analyze plot: Activation times are wrong in tooltip if the decimal part starts with zero Openbug 🐛
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug 🐛 sd-boot/sd-stub/bootctl
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
journal RFE 🎁
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
bug 🐛 ssh-generator
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100