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

sd_notify does not work with chroot #27

Open
dasJ opened this issue Jul 4, 2022 · 1 comment
Open

sd_notify does not work with chroot #27

dasJ opened this issue Jul 4, 2022 · 1 comment

Comments

@dasJ
Copy link

dasJ commented Jul 4, 2022

Inspecting systemctl status rtkit-daemon shows no Status: line.
This is because the daemon cannot access the notify socket after chroot():

[pid  1777] sendmsg(7<UNIX:[186709]>, {msg_name={sa_family=AF_UNIX, sun_path="/run/systemd/notify"}, msg_namelen=22, msg_iov=[{iov_base="STATUS=Supervising 6 threads of 4 processes of 1 users.", iov_len=55}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = -1 ENOENT (No such file or directory)

The only solution I can think of is opening the socket before chrooting and writing to the existing socket rather than using sd_notify.

@dasJ
Copy link
Author

dasJ commented Jul 4, 2022

Found this workaround in the systemd unit:

[Service]
TemporaryFileSystem=/proc/fs
BindPaths=/run/systemd/notify:/proc/fs/sd-notify
Environment=NOTIFY_SOCKET=/fs/sd-notify

We need to use the fs folder because we cannot create new folders in /proc and we need to mount a new tmpfs over it because we cannot create new files in the folder.

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

No branches or pull requests

1 participant