GNOME Bugzilla – Bug 659367
Crash clicking System Info
Last modified: 2011-09-20 01:38:22 UTC
Crash when clicking "System Info" with the following message: info-cc-panel:ERROR:cc-info-panel.c:1140:info_panel_setup_hostname: assertion failed: (self->priv->hostnamed_proxy) Aborted Version: 3.1.91
Which version of systemd and distribution are you using? The crash is in those lines: 1149 /* This could only happen if the policy file was installed• 1150 * but not hostnamed, which points to a system bug */• 1151 g_assert (self->priv->hostnamed_proxy);• It would mean that you have the PolicyKit file installed for "org.freedesktop.hostname1.set-static-hostname", but not the service, which would be a configuration problem in your distribution.
Removing systemd solves the issue. I had systemd installed but not using it in favour of the regular Archlinux initscripts. I had that config even whit gnome-control-center 3.0.X but it never crahed before. systemd-35 systemd-arch-units-20110902 initscripts-systemd-v25
hostnamed is usable without using systemd as the init system. It's just badly packaged in ArchLinux it seems (they ship the PolicyKit file without the service, it would seem).
Reported to Archlinux.
Hi, I'm the systemd packager from Arch. I'm not sure how this is a packaging bug on our part. We provide everything needed for hostnamed, including the service you mention: /etc/dbus-1/system.d/org.freedesktop.hostname1.conf /lib/systemd/system/dbus-org.freedesktop.hostname1.service /lib/systemd/system/systemd-hostnamed.service /lib/systemd/systemd-hostnamed /usr/share/dbus-1/interfaces/org.freedesktop.hostname1.xml /usr/share/dbus-1/system-services/org.freedesktop.hostname1.service /usr/share/polkit-1/actions/org.freedesktop.hostname1.policy We make no modifications to any of these files. It seems to me that without systemd running, hostnamed fails to start.
To clarify: If one starts /lib/systemd/systemd-hostnamed manually prior to launching system-info-applet, there is no crash. This only occurs when hostnamed is asked to autospawn without systemd available on the system bus.
(In reply to comment #6) > To clarify: If one starts /lib/systemd/systemd-hostnamed manually prior to > launching system-info-applet, there is no crash. This only occurs when > hostnamed is asked to autospawn without systemd available on the system bus. That would mean that it doesn't auto-start properly. I'm fairly certain it doesn't need systemd to be running (and there's nothing in the code for hostnamed that would show this). If it does, it's a systemd bug.
This is slowly making more sense... So, based on the dbus service definition, I'd say that yes, this does require systemd. hostnamed depends on /etc/hostname, /etc/machine-id and /etc/machine-info, all of which may not be present on non-systemd machines. Furthermore, the service declares Exec=/bin/false, which ensures that this service never starts under sysvinit. If the service fails to start, it seems to me that g-c-c should be gracefully handling the failure.
(In reply to comment #8) > This is slowly making more sense... > > So, based on the dbus service definition, I'd say that yes, this does require > systemd. hostnamed depends on /etc/hostname, /etc/machine-id and > /etc/machine-info, all of which may not be present on non-systemd machines. > Furthermore, the service declares Exec=/bin/false, which ensures that this > service never starts under sysvinit. If the service fails to start, it seems to > me that g-c-c should be gracefully handling the failure. Indeed. It's a bug in systemd. Those helpers should be usable without systemd running.
(In reply to comment #3) > hostnamed is usable without using systemd as the init system. It's just badly > packaged in ArchLinux it seems (they ship the PolicyKit file without the > service, it would seem). This is not true. hostnamed is not able to write legacy configuration files (the policy here is: read legacy files, write new standardized files). Since non-systemd systems generally don't follow what we defined as "standardized" files hostnamed will not be useful on those systems. Note that I am not interested in maintaining compatibility hacks for the old files to make this work. The focus for systemd here is clearly on cooperating on interfaces, not code. We carefully made sure that the interfaces are not systemd specific, and well documented. (http://www.freedesktop.org/wiki/Software/systemd/hostnamed). If people want this stuff to work on other distributions, then they are welcome to implement this on their own, or even base this on our code if they wish, but maintain it on their own. systemd itself is not a dumpster for abstracting legacy interfaces. In any case hostnamed is probably something administrators can disable if they want to, and GNOME shouldn't crash in that case. I believe the CC should not hit an assert here.
(In reply to comment #10) > (In reply to comment #3) > > hostnamed is usable without using systemd as the init system. It's just badly > > packaged in ArchLinux it seems (they ship the PolicyKit file without the > > service, it would seem). > > This is not true. hostnamed is not able to write legacy configuration files > (the policy here is: read legacy files, write new standardized files). Since > non-systemd systems generally don't follow what we defined as "standardized" > files hostnamed will not be useful on those systems. Note that I am not > interested in maintaining compatibility hacks for the old files to make this > work. The problem isn't the file locations, or content, but the fact that the service cannot be autostarted if systemd isn't running. That could be seen as a packaging problem though, as the service on-disk is completely unusable if systemd isn't the init system.
(In reply to comment #11) > The problem isn't the file locations, or content, but the fact that the service > cannot be autostarted if systemd isn't running. That's intentional, and done for packages like Avahi, bluez, NetworkManager. The future plan is to teach D-Bus about native systemd service files. At that point, no D-Bus system service file will be installed anymore, and non-systemd boots will not see the service at all.
(In reply to comment #11) > (In reply to comment #10) > > (In reply to comment #3) > > > hostnamed is usable without using systemd as the init system. It's just badly > > > packaged in ArchLinux it seems (they ship the PolicyKit file without the > > > service, it would seem). > > > > This is not true. hostnamed is not able to write legacy configuration files > > (the policy here is: read legacy files, write new standardized files). Since > > non-systemd systems generally don't follow what we defined as "standardized" > > files hostnamed will not be useful on those systems. Note that I am not > > interested in maintaining compatibility hacks for the old files to make this > > work. > > The problem isn't the file locations, or content, but the fact that the service > cannot be autostarted if systemd isn't running. That could be seen as a > packaging problem though, as the service on-disk is completely unusable if > systemd isn't the init system. But what would it be good for if hostnamed is autostarted and then used to write a file to /etc/hostname which is not read by the distribution at boot to set the hostname?
Reopening, seeing as this discussion is going nowhere.
Created attachment 197010 [details] [review] info: Don't crash when systemd isn't used It's possible to have systemd installed, including hostnamed, but have it not be the init system, in which case it will fail to auto-start. Handle that case instead of crashing.
Daniele, please test with this patch, and let me know whether it fixes your crasher.
(In reply to comment #15) > Created an attachment (id=197010) [details] [review] > info: Don't crash when systemd isn't used > > It's possible to have systemd installed, including hostnamed, > but have it not be the init system, in which case it will fail > to auto-start. Handle that case instead of crashing. Thanks a lot. This looks much better. I am happy!
Patched against g-c-c 3.1.91. Works fine now, reporting the following when clicking System Info: (gnome-control-center:28882): info-cc-panel-WARNING **: Error getting PackageKit transaction ID: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PackageKit was not provided by any .service files
Created attachment 197012 [details] [review] info: Don't warn if PackageKit isn't around
Even better. Thanks Bastien!
Attachment 197010 [details] pushed as 32106ff - info: Don't crash when systemd isn't used Attachment 197012 [details] pushed as 429b0b4 - info: Don't warn if PackageKit isn't around