[systemd-devel] PAMName=login, systemctl stop

Lennart Poettering lennart at poettering.net
Wed Jun 28 16:04:04 UTC 2023


On Do, 22.06.23 16:22, Valentijn Sessink (valentijn at sessink.nl) wrote:

> Hello list,
>
> I have a rather simple service file that sets up a user session with
> "PAMName=login", then starts a script and a few (old X11 related) programs.
> Starting it is easy, but stopping the service will send SIGTERM only to the
> main process, because "Any child processes of that process will however be
> associated with the session scope unit only" - as per man systemd.exec(5).
>
> Is there a way to amend the service file to stop these children?

Not really, from systemd's PoV they are part of the login session, not
the original service anymore.

You can't have it both ways: be a session and a service. In system
it's either/or.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list