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

Re: upstart: please update to latest upstream version

Steve Langasek wrote:
> There are also complications to using cgroups, in that suddenly any service
> that needs to be able to spawn long-running processes that outlive the
> service has to start caring about cgroups - both so that they survive the
> service being shut down from the outside, and so that the supervisor knows
> not to count these processes as evidence that the service is still running.

In most cases the daemon does not need to care about these, and at most
simple options in the .service file are needed. systemd has a concept of
"main process" which is used to determine whether or not the service has
failed (with a couple of possible ways to identify this - for "nicely
behaving" daemons this is just the process originally started by
systemd). The "KillMode" option in .service files can be used to control
which processes are killed (default is everything in the cgroup,
alternatives are just the main process or nothing).

The systemd.service man page is worth reading to see the available

> ssh is going to be the first problem in this regard, though I'm sure there
> will be others.  Has someone patched openssh to be cgroup-aware?

As above, setting KillMode is enough to avoid killing spawned processes.

Logins through ssh do have their own cgroup rather than being placed
under the sshd.service cgroup. However, I think that doesn't happen due
to any changes in sshd, but is probably handled by the generic user
session management triggered through libpam-systemd.

Reply to: