Re: PAMName=login, systemctl stop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mo, 03.07.23 10:58, Valentijn Sessink (valentijn@xxxxxxxxxx) wrote:

> Now my remaining question is probably so very basic, that you sort of missed
> it: my "session" is started from a script and so I'm probably able to stop
> all services in the session from within this script - if I knew how to find
> "it": "it" being "the thing to stop", i.e. "my own session" or something
> like that. I.e. the script should kill itself and all its children.

logind's session ID you'll find in the $XDG_SESSION_ID env var.

you can use this to kill your own session:

    loginctl kill-session $XDG_SESSION_ID

if you want to know which systemd unit your process belongs to use:

    ps --pid $$ -o unit=

Lennart

--
Lennart Poettering, Berlin



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux