• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Linux OS Service ‘haldaemon’

by admin

Description

The Linux Hardware Abstraction Layer (HAL) implements a coherent description of all the hardware on a system, including hot-plugged devices such as on USB (Universal Serial Bus). It works by merging information presented by the operating system, the physical hardware, device drivers, subsystems such as CUPS (Common Unix Printing System), and even from system administrators. This information is collated and made available to application programs via a HAL programming interface.

The haldaemon service invokes the HAL daemon process hald to obtain the kernel-level data via the kernel D-BUS communication channel to collect and to distribute this information. Device data are presented in key+value attribute pairs.

One client of the HAL service is the fstab-sync(8) facility that automatically updates/etc/fstab in response to disk drives coming online. This just applies to CentOS/RHEL 4. fatab-sync facility has been disabled and new mount support on CentOS/RHEL 5 is introduced.

Configuration

To manage the haldaemon service for future shutdowns and reboots, use the chkconfig tool:

# /sbin/chkconfig haldaemon on
# /sbin/chkconfig --list haldaemon
haldaemon 0:off 1:off 2:on 3:on 4:on 5:on 6:off

To control the haldaemon service immediately, use the service tool:

# /sbin/servie haldaemon
Uage: /etc/init.d/haldaemon {start|stop|status|restart|condrestart}

Start or stop the daemon:

# /sbin/service haldaemon start
Starting HAL daemon:                                       [  OK  ]
# /sbin/service haldaemon stop
Stopping HAL daemon:                                       [  OK  ]

RPM Package name: hal

e.g. hal-0.5.8.1-38.el5.i386

Once this daemon service(haldaemon) is running, it is available to list devices and their properties with utility “lshal“. For example:

# lshal
Dumping 49 device(s) from the Global Device List:
-------------------------------------------------
udi = '/org/freedesktop/Hal/devices/pci_8086_2770'
info.parent = '/org/freedesktop/Hal/devices/computer' (string)
info.udi = '/org/freedesktop/Hal/devices/pci_8086_2770' (string)
pci.device_protocol = 0 (0x0) (int)
pci.device_subclass = 0 (0x0) (int)
pci.device_class = 6 (0x6) (int)
info.vendor = 'Intel Corporation' (string)
info.product = '82945G/GZ/P/PL Memory Controller Hub' (string)
pci.subsys_vendor = 'Dell' (string)
pci.product = '82945G/GZ/P/PL Memory Controller Hub' (string)
pci.vendor = 'Intel Corporation' (string)
pci.subsys_product_id = 429 (0x1ad) (int)
pci.subsys_vendor_id = 4136 (0x1028) (int)
pci.product_id = 10096 (0x2770) (int)
pci.vendor_id = 32902 (0x8086) (int)
pci.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:00.0' (string)
linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:00.0' (string)
linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:00.0' (string)
info.bus = 'pci' (string)
... ...

The haldaemon is minimally-configurable using the file:

/etc/hal/hald.conf

It is an XML file. For example:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<!-- This configuration file controls the Hardware Abstraction Layer
     daemon - it is meant that OS vendors customize this file to reflect
     their desired policy.
  -->

<haldconfig>

  <!-- If true, then the device list is saved to disk such that
       properties are kept between invocations of hald.
    -->
  <persistent_device_list>false</persistent_device_list>

  <!-- Default value for storage.media_check_enabled for devices of
       capability storage - this can be overridden by .fdi files.

       Setting this to false results a whitelist policy, e.g. media
       check is only enabled for storage devices with a .fdi file
       saying so.

       Conversely, setting it to true results in a blacklist policy
       where media check is enabled by default but may be overridden
       by a .fdi for devices causing trouble.
  -->
  <storage_media_check_enabled>true</storage_media_check_enabled>


  <!-- Default value for storage.automount_enabled_hint for devices of
       capability storage - this can be overridden by .fdi files.

       Setting this to false results a whitelist policy, e.g. policy
       agents should only automount storage devices with a .fdi file
       saying so.

       Conversely, setting it to true results in a blacklist policy
       where policy agents should always automount unless this is
 explicitly overridden by .fdi for devices causing trouble.
  -->
  <storage_automount_enabled_hint>true</storage_automount_enabled_hint>

</haldconfig>

Filed Under: Linux, Linux Services

Some more articles you might also be interested in …

  1. nmcli radio Command Examples in Linux
  2. setsid: command not found
  3. How to schedule Jobs with Cron in Linux
  4. rmmod: command not found
  5. lrzip Command Examples in Linux
  6. v4l2-ctl: command not found
  7. audacious: An open-source audio player (Command Examples)
  8. csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database
  9. yum-config-manager: command not found
  10. How to Migrate CentOS/RHEL 6 iptables Rules to CentOS/RHEL 7 firewalld

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright