Before23ac08115a, even if we failed to create the cgroup for a unit, a cgroup runtime object for the cgroup is created with the cgroup path. Hence, the creation of cgroup is failed, execution of the unit will fail in posix_spawn_wrapper() and logged something like the following: ``` systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory systemd[1]: testservice.service: Failed to spawn executor: No such file or directory systemd[1]: testservice.service: Failed to spawn 'start' task: No such file or directory systemd[1]: testservice.service: Failed with result 'resources'. systemd[1]: Failed to start testservice.service. ``` However, after the commit, when we failed to create the cgroup, a cgroup runtime object is not created, hence NULL will be assigned to ExecParameters.cgroup_path in unit_set_exec_params(). Hence, the unit process will be invoked in the init.scope. ``` systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory systemd[1]: Starting testservice.service... cat[1094]: 0::/init.scope systemd[1]: testservice.service: Deactivated successfully. systemd[1]: Finished testservice.service. ``` where the test service calls 'cat /proc/self/cgroup'. To fix the issue, let's fail earlier when we failed to create cgroup. Follow-up for23ac08115a(v258).
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
