-
Notifications
You must be signed in to change notification settings - Fork 601
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
interfaces/builtin/hostname_control.go: fix call to hostnamectl in core24 #15196
interfaces/builtin/hostname_control.go: fix call to hostnamectl in core24 #15196
Conversation
…re24 Since systemd/systemd#27573 we need to allow binding on the client side of the dbus socket. Also hostnamectl seems to need to read properties on /org/freedesktop/systemd1 which should be fine. To reproduce the issue, try to call `hostnamectl` from a snap on Ubuntu Core 24.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15196 +/- ##
==========================================
- Coverage 78.09% 78.08% -0.02%
==========================================
Files 1190 1194 +4
Lines 158458 158585 +127
==========================================
+ Hits 123746 123825 +79
- Misses 27017 27059 +42
- Partials 7695 7701 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM
@@ -65,6 +71,9 @@ dbus(receive, send) | |||
interface=org.freedesktop.hostname1 | |||
member=Set{,Pretty,Static}Hostname, | |||
|
|||
# hostnamectl needs to bind the client side of the socket | |||
unix (bind) type=stream addr="@*/bus/hostnamectl/system", |
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.
for those left wondering:
$ strace -vf -e bind,connect,socket,recvmsg,sendmsg hostnamectl
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
bind(3, {sa_family=AF_UNIX, sun_path=@"8ad6795a6c6318c/bus/hostnamectl/system"}, 41) = 0
connect(3, {sa_family=AF_UNIX, sun_path="/run/dbus/system_bus_socket"}, 30) = 0
Fri Mar 14 08:10:05 UTC 2025 Failures:Executing:
Restoring:
|
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.
LGTM!
Since systemd/systemd#27573 we need to allow binding on the client side of the dbus socket.
Also hostnamectl seems to need to read properties on /org/freedesktop/systemd1 which should be fine.
To reproduce the issue, try to call
hostnamectl
from a snap on Ubuntu Core 24.