Bug #14226
closedservice/hal needs restart after hardware change
0%
Description
Hi,
This issue was originally reported by Gary Mills but I just log it here for further reference.
On my OpenIndiana system running OI 2021.10
$pkg list osnet-incorporation dbus hal
NAME (PUBLISHER) VERSION IFO
consolidation/osnet/osnet-incorporation 0.5.11-2020.0.1.20768 i--
service/hal 0.5.11-2020.0.1.20768 i--
system/library/dbus 1.12.20-2020.0.1.1 i--
This is OI 2021.10
$ cat /etc/release
OpenIndiana Hipster 2021.10 (powered by illumos)
OpenIndiana Project, part of The Illumos Foundation (C) 2010-2021
Use is subject to license terms.
Assembled 30 October 2021
After changing some hardware such as adding a USB webcam, audio card, card reader, keyboard or mouse or USB storage, the command "lshal" which lists the hal hardware, does not show the new hardware.
When issuing
svcadm restart hal
it works for me: the new hardware is in the output of the command "lshal".
There has been work on this by Gary Mills to show via "dtrace" that hal is actually getting a request to update the database via 'dbus' but it is unclear to me whether this is a dbus error or both hal and dbus or dbus-daemon issue.
The workaround that works for me is to use the command : svcadm restart hal
or also:
svcadm disable hal
svcadm enable hal
Because the restart_on attribute of the dependents like rmvolmgr and lightdm is set to "none" , I think that restarting hal does not force a restart / kill of lightdm desktop or rmvolmgr.
Related issues
Updated by David Stes almost 2 years ago
- Related to Bug #13711: USB Flash Drive does not automount correctly added
Updated by David Stes almost 2 years ago
- Related to Bug #14216: Problem with USB added
Updated by David Stes almost 2 years ago
- Related to Bug #13858: x11 hot plug keyboard does not work added
Updated by David Stes almost 2 years ago
- Related to Bug #14227: USB automount failure implicates hald added
Updated by David Stes over 1 year ago
The restart of HAL is not required for me under OpenIndiana with USB storage on a Dell Precision 3640 with USB 3.1 xhci driver and using the following new glib2 package:
$ pkg info glib2
Name: library/glib2
Summary: GNOME core libraries
Category: Desktop (GNOME)/Libraries
Version: 2.66.8
Branch: 2022.0.0.1
Packaging Date: March 18, 2022 at 12:07:09 PM
Source URL: https://download.gnome.org/sources/glib/2.62/glib-2.62.6.tar.xz
Note that 2.66.8 revision 1 is actually glib-2.62.6.
Given the complexity of the issue, it is unclear to me whether the HAL version and DBUS version is also relevant.
The test (where usb did not require a HAL restart and HAL picked up usb changes) was using
service/hal 0.5.11-2022.0.0.21013 i--
system/library/dbus 1.12.20-2020.0.1.1 i--
system/library/dbus/dbus-x11 1.12.20-2020.0.1.1 i--
system/library/libdbus 1.12.20-2020.0.1.1 i--
system/library/libdbus-glib 0.112-2022.0.0.0 i--
Updated by David Stes over 1 year ago
Unfortunately the "hal" daemon is again not seeing the hardware change when a USB drive is attached with the following new setup:
- pkg list hal dbus libdbus-glib media-volume-manager glib2
NAME (PUBLISHER) VERSION IFO
library/glib2 2.70.0-2022.0.0.0 i--
service/hal 0.5.11-2022.0.0.21024 i--
service/storage/media-volume-manager 0.5.11-2022.0.0.21024 i--
system/library/dbus 1.12.20-2020.0.1.1 i--
system/library/libdbus-glib 0.112-2022.0.0.0 i--
the old solution of restarting hal helps :
- svcadm disable hal
- svcadm disable rmvolmgr
- svcadm enable hal
- sleep 30; svcs hal
- svcadm enable rmvolmgr
the sleep 30 is because it seems to take a while now for hal to restart but eventually svcs hal reports it is online again.
The sleep is to avoid enabling rmvolmgr while hal is still in offline* state.
Updated by David Stes over 1 year ago
Also see Debugging issues with eject and hal in the documention
[[
http://docs.openindiana.org/handbook/community/quikstor/]]
and the link there to the documentation
[[
https://iks.cs.ovgu.de/~elkner/s11/rmmount.html
]]
Updated by David Stes over 1 year ago
It is useful to debug this issue with the command:
dbus-monitor --session
Currently it works for me succesfully with the following packages:
- pkg list media-volume-manager hal glib2 dbus
NAME (PUBLISHER) VERSION IFO
library/glib2 2.70.0-2022.0.0.1 i--
service/hal 0.5.11-2022.0.0.21026 i--
service/storage/media-volume-manager 0.5.11-2022.0.0.21026 i--
system/library/dbus 1.12.20-2020.0.1.1 i--
- pkg contents -t depend media-volume-manager
TYPE FMRI
require pkg:/system/library/libdbus-glib@0.112-2022.0.0.0
require pkg:/shell/ksh93@93.21.1.20120801-2022.0.0.21026
require pkg:/library/glib2@2.70.0-2022.0.0.0
require pkg:/SUNWcs@0.5.11-2022.0.0.21026
require pkg:/service/hal@0.5.11-2022.0.0.21026
require pkg:/system/library/libdbus@1.12.20-2020.0.1.1
require pkg:/service/storage/removable-media@0.5.11-2022.0.0.21026
require pkg:/system/library@0.5.11-2022.0.0.21026
require pkg:/system/library/dbus@1.12.20-2020.0.1.1
require consolidation/osnet/osnet-incorporation
The above combination works and HAL receives an update of the USB hardware change.
Updated by David Stes over 1 year ago
The above packages claim to use glib2 2.70 but those are built from 2.62
pkg://openindiana.org/library/glib2@2.70.0,5.11-2022.0.0.1:20220331T113620Z
built from https://download.gnome.org/sources/glib/2.62/glib-2.62.6.tar.xz
Updated by David Stes over 1 year ago
- Related to Bug #14615: glib2 2.70.0 (0.0.1) is actually glib2 2.62.6 added
Updated by David Stes over 1 year ago
with glib2 2.62 (installed as 2.70 . 0.0.2) on my OpenIndiana system, if I insert a USB device and monitor it with :
$ dbus-monitor --session --profile | grep RemoteVolumeMonitor
I see events on the dbus-monitor output like :
1. DriveConnected
2. DriveChanged
3. VolumeAdded
4. VolumeMount
5. VolumeChanged
6. MountAdded
For the versions of OpenIndiana that have glib2 > 2.62 it is not known whether dbus-monitor shows the same events and HAL is not updated.
Updated by Carsten Grzemba 12 months ago
It seems to be related to glib change (git show c8811da56a6628d9df8a9fa0051c42e6bff94cd6) introduced with 2.63.6:
diff --git a/glib/giochannel.c b/glib/giochannel.c index ed8546331..d16399846 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -1669,8 +1669,16 @@ g_io_channel_read_line (GIOChannel *channel, if (status == G_IO_STATUS_NORMAL) { + gchar *line; + + /* Copy the read bytes (including any embedded nuls) and nul-terminate. + * `USE_BUF (channel)->str` is guaranteed to be nul-terminated as it’s a + * #GString, so it’s safe to call g_memdup() with +1 length to allocate + * a nul-terminator. */ g_assert (USE_BUF (channel)); - *str_return = g_strndup (USE_BUF (channel)->str, got_length); + line = g_memdup (USE_BUF (channel)->str, got_length + 1); + line[got_length] = '\0'; + *str_return = g_steal_pointer (&line); g_string_erase (USE_BUF (channel), 0, got_length); } else
reverting this change, it works like before.
Updated by Carsten Grzemba 12 months ago
This is the related glib issue:
https://gitlab.gnome.org/GNOME/glib/-/issues/2002
it seems resonable.
No idea what dbus (or whoever) sends here to hald.
This is the code snipped in hald (solaris/sysevent.c)
while (g_io_channel_read_line (sysevent_iochannel, &s, &len, NULL, &err) == G_IO_STATUS_NORMAL) { if (len == 0) { break; } HAL_INFO (("IOChannel val => %s", s));
Before the change the len != 0 and the while loop statements was executed.
Updated by Carsten Grzemba 12 months ago
- Related to Bug #15025: hald can't anymore receive events with newer glib versions than 2.63.4 added
Updated by Marcel Telka 11 months ago
- Status changed from New to Resolved
Fixed in illumos-gate via #15025.