Re: What are Abandon() and AbandonScope() used for?

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

 



Hello.

On Tue, Jan 23, 2024 at 04:40:35PM +0100, Felip Moll <felip@xxxxxxxxxxx> wrote:
> Can somebody give me an insight of what these methods really do?
> The documentation is pretty vague:
> https://www.freedesktop.org/wiki/Software/systemd/dbus/

Those would most probably pair with
org.freedesktop.systemd1.Scope.RequestStop DBus signal -- an organized
way how systemd stops scope.

I.e. there can be a "controller" of the scope that would respond to such a
signal with some graceful termination of the scope. Lifetimes of the
scope and controller may be independent and when controller terminates,
it can mark the scope as abandoned (instead of killing its processes or
disappearing without notice).

That's the theory, practice would be logind~controller of its session
scopes.

> When should I use this? For example I am creating a scope which will
> allocate some pids into their cgroups. The scope is created from a daemon
> run from a service unit. The service will eventually be shut down and I
> want the scope to remain if it has pids in it. Should the service "abandon"
> the scope?

That depends whether you want some extra stopping procedure for your
scope besides regular SIGTERM logic.

HTH,
Michal

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux