stage1/init: only consider running from unit file when session leader #1694
stage1/init: only consider running from unit file when session leader #1694
Conversation
This means that if a systemd unit file has a I guess it's a reasonable compromise. |
Maybe there should also be a way to explicitly set --keep-unit, for when the heuristics fail? |
// int | ||
// am_session_leader() | ||
// { | ||
// return (getsid(0) == getpid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to include <unistd.h>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added, good catch
I think this is reasonable and I don't think we need a flag for |
This augments the heuristics used to err on the side of non-unit-file, but will still consider as run from a unit file when executed directly via systemd.service Exec* directives. With this change, interactive invocations of rkt on CoreOS cease passing --keep-unit to nspawn. Fixes #1664
I think this is good as it is. Do you think it is worth documenting in Advanced Unit File? Something like:
|
can't hurt |
…der_too stage1/init: only consider running from unit file when session leader
After rkt#1694, rkt needs to be the group leader in a systemd unit file to make unit file detection work. Add some documentation on the topic.
After rkt#1694, rkt needs to be the group leader in a systemd unit file to make unit file detection work. Add some documentation on the topic.
After rkt#1694, rkt needs to be the group leader in a systemd unit file to make unit file detection work. Add some documentation on the topic.
This augments the heuristics used to err on the side of non-unit-file,
but will still consider as run from a unit file when executed directly
via systemd.service Exec* directives.
With this change, interactive invocations of rkt on CoreOS cease passing
--keep-unit to nspawn.
Fixes #1664