]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/systemd.exec.xml
core: add RemoveIPC= setting
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Aug 2016 17:24:40 +0000 (19:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Aug 2016 22:37:25 +0000 (00:37 +0200)
commit00d9ef8560c252d8504be99cb38d1a54d35a9144
tree388323761f8f32b4ec3b83a017a8931c4fd450b9
parent51d73fd96a55810ca40324eec098e66c6657699b
core: add RemoveIPC= setting

This adds the boolean RemoveIPC= setting to service, socket, mount and swap
units (i.e.  all unit types that may invoke processes). if turned on, and the
unit's user/group is not root, all IPC objects of the user/group are removed
when the service is shut down. The life-cycle of the IPC objects is hence bound
to the unit life-cycle.

This is particularly relevant for units with dynamic users, as it is essential
that no objects owned by the dynamic users survive the service exiting. In
fact, this patch adds code to imply RemoveIPC= if DynamicUser= is set.

In order to communicate the UID/GID of an executed process back to PID 1 this
adds a new "user lookup" socket pair, that is inherited into the forked
processes, and closed before the exec(). This is needed since we cannot do NSS
from PID 1 due to deadlock risks, However need to know the used UID/GID in
order to clean up IPC owned by it if the unit shuts down.
21 files changed:
man/systemd.exec.xml
src/core/dbus-execute.c
src/core/dbus-mount.c
src/core/dbus-service.c
src/core/dbus-socket.c
src/core/dbus-swap.c
src/core/execute.c
src/core/execute.h
src/core/manager.c
src/core/manager.h
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c
src/core/unit.c
src/core/unit.h
src/login/logind-user.c
src/shared/bus-unit-util.c
src/shared/clean-ipc.c
src/shared/clean-ipc.h
src/test/test-ipcrm.c