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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

Linux OS Service ‘acpid’

By admin

The acpid daemon supports the Advanced Configuration and Power Interface (ACPI) to allow intelligent power management on your system and to query battery and configuration status. It listens on a file (/proc/acpi/event) and when an event occurs, executes programs to handle the event. Rules are defined by simple configuration files. acpid will look in a configuration directory (/etc/acpi/events by default), and parse all files that do not begin with a period (‘.’). Each file must define two things: an event and also a corresponding action.

This service is provided by acpid RPM package.

# yum install acpid

Service Control

To control the acpid service after the next system boot, use the chkconfig utility:

# chkconfig acpid on
# chkconfig --list acpid
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off

To control the acpid service immediately, use the service utility:

# service  acpid
Usage: /etc/init.d/acpid {start|stop|status|restart|condrestart|reload}

Start the service as follows:

# service acpid start
Starting acpi daemon:                                      [  OK  ]

Stop the service as follows:

# service acpid stop
Stopping acpi daemon:                                      [  OK  ]

Check if the serivce is started or stopped:

# service acpid status
acpid is stopped

If the service is started, then restart it, otherwise do nothing.

# service acpid condrestart
Stopping acpi daemon:                                      [  OK  ]
Starting acpi daemon:                                      [  OK  ]

Determine which system run levels the service is active:

# chkconfig --list acpid
acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off

Configuration

The acpid daemon listens on a file (/proc/acpi/event) and when an event occurs, executes programs to handle the event. Rules are defined by simple configuration files. acpid will look in a configuration directory (/etc/acpi/events by default), and parse all files that do not begin with a period (‘.’). Each file must define two things: an event and also an corresponding action.

# ll /etc/acpi/events
total 8
-rw-r--r-- 1 root root 168 Nov 12  2015 power.conf
-rw-r--r-- 1 root root 236 Nov 12  2015 video.conf
# cat /etc/acpi/events/power.conf
# ACPID config to power down machine if powerbutton is pressed, but only if
# no gnome-power-manager is running

event=button/power.*
action=/etc/acpi/actions/power.sh
# cat /etc/acpi/events/video.conf
# Configuration to turn on DPMS again on video activity, needed for some
# laptops. Disabled by default, uncomment if your laptop display stays blank
# after you close and open the lid.

#event=video.*
#action=/usr/sbin/vbetool dpms on

Filed Under: Linux, Linux Services

Some more articles you might also be interested in …

  1. UNIX / Linux : How crontab validates the access based on the cron.allow and cron.deny files
  2. Understanding The sysfs File System (/sys) in Linux
  3. Slow SSH login due to unreachable rsyslog server
  4. Linux OS Service ‘vncserver’
  5. CentOS/RHEL – vgs command reports error: “global/global_filter” unknown
  6. Linux OS service ‘dhcpd’
  7. Beginner’s Guide to LVM (Logical Volume Management)
  8. CentOS / RHEL 6 : How do I find my current runlevel?
  9. What are different Samba Server Types
  10. CentOS / RHEL 7 : systemctl replacements of legacy commands service and chkconfig

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary