Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sleep for non-root calls of systemd-notify #2822

Closed
wants to merge 1 commit into from

Conversation

binarin
Copy link

@binarin binarin commented Mar 10, 2016

Fixes #2739

Without CAP_SYS_ADMIN it's not possible to fake user credentials in
sd_pid_notify call, and in this case everything depends on timing -
whether systemd will be able to get the cgroup of sending process before
it exists or not.

Adding sleep(3) for non-root users will at least make systemd-notify
useful for them.

Fixes systemd#2379

Without `CAP_SYS_ADMIN` it's not possible to fake user credentials in
`sd_pid_notify` call, and in this case everything depends on timing -
whether systemd will be able to get the cgroup of sending process before
it exists or not.

Adding `sleep(3)` for non-root users will at least make `systemd-notify`
useful for them.
@zonque
Copy link
Member

zonque commented Mar 10, 2016

Sleeping is certainly the wrong solution. Even with this in, you might still see the problem, depending on what else is going on on your system. So no, sleeping is never a fix for racy behavior, this needs a different solution. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants