unit_name_mangle_with_suffix() is quite benevolent by default and allows the unit to "transition" into a different unit type than what's requested via its suffix argument. For example, calling unit_name_mangle_with_suffix() with "/foo/bar" as a unit name and ".service" as a suffix would give you "foo-bar.mount", without any warning or error. This could then lead to a quite confusing errors in certain situations: ~# systemd-run --remain-after-exit --unit /foo/bar true Failed to start transient service unit: Cannot set property RemainAfterExit, or unknown property. Given we can't change the default behaviour of unit_name_mangle_with_suffix() as some parts of systemd already depend on its "benevolence" (like systemctl), let's introduce a new flag - UNIT_NAME_MANGLE_STRICT - that checks if the mangled/resolved unit name's suffix matches the requested one and errors out if not. With the flag used throughout systemd-run's code, the error in the above case is now a bit more clear: ~# build/systemd-run --remain-after-exit --unit /foo/bar true Path "/foo/bar" resolves to unit type "mount", but "service" is expected as unit. Failed to mangle unit name: Invalid argument Resolves: #39996
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
