2009-05-25

Disable Hal Daemon Polling

I had cause today to stop hal from polling its CD-ROM/DVD-ROM drives on a large number of systems.

$ cat /etc/hal/fdi/information/disable-polling.fdi
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
<device>
<match key="storage.media_check_enabled" bool="true">
<merge key="storage.media_check_enabled" type="bool">false</merge>
</match>
</device>
</deviceinfo>
This will turn of the 'media check' which polls the IDE device every 2 seconds to see if a CD is inserted. None of these systems have anything listening to HAL events, nor will have removable media inserted, so we can safely ignore the events.

hal-disable-polling is an ''interesting'' program. C programmers doing this stuff should really get an XML library that's useful, and actually use it. Using fprintf for emitting xml isn't kosher :(