acpid linux command man page (2024)

Section: Maintenance Commands (8)
Updated:
IndexReturn to Main Contents

NAME

acpid - Advanced Configuration and Power Interface event daemon

SYNOPSIS

acpid [options]

DESCRIPTION

acpid is designed to notify user-space programs of ACPI events.acpid should be started during the system boot, and will run as abackground process, by default. It will open an events file(/proc/acpi/event by default) and attempt to read whole lines whichrepresent ACPI events. If the events file does not exist, acpid willattempt to connect to the Linux kernel via the input layer and netlink. When anACPI event is received from one of these sources, acpid will examine alist of rules, and execute the rules that match the event. acpid willignore all incoming ACPI events if a lock file exists (/var/lock/acpid bydefault).

Rules are defined by simple configuration files. acpidwill look in a configuration directory (/etc/acpi/events by default),and parse all regular files with names that consist entirely of upper andlower case letters, digits, underscores, and hyphens (similar to run-parts(8)).Each file must define two things: an event and anaction. Any blank lines, or lines where the first character is ahash ('#') are ignored. Extraneous lines are flagged as warnings, butare not fatal. Each line has three tokens: the key, a literal equal sign,and the value. The key can be up to 63 characters, and is case-insensitive(but whitespace matters). The value can be up to 511 characters, and iscase and whitespace sensitive.

The event value is a regular expression (see regcomp(3)), against which events are matched.

The action value is a commandline, which will be invoked via /bin/shwhenever an event matching the rule in question occurs. The commandline mayinclude shell-special characters, and they will be preserved. The only specialcharacters in an action value are "%" escaped. The string "%e" will bereplaced by the literal text of the event for which the action was invoked.This string may contain spaces, so the commandline must take care to quote the "%e" if it wants a single token. The string "%%" will be replaced by aliteral "%". All other "%" escapes are reserved, and will cause a rule tonot load.

This feature allows multiple rules to be defined for the same event (though noordering is guaranteed), as well as one rule to be defined for multiple events.To force acpid to reload the rule configuration, send it a SIGHUP.

The pseudo-action <drop> causes the event to be droppedcompletely and no further processing undertaken; clients connectingvia the UNIX domain socket (see below) will not be notified of theevent. This may be useful on some machines, such as certain laptops whichgenerate spurious battery events at frequent intervals. The name ofthis pseudo-action may be redefined with a commandline option.

In addition to rule files, acpid also accepts connections on a UNIXdomain socket (/var/run/acpid.socket by default). Any application mayconnect to this socket. Once connected, acpid will send the text ofall ACPI events to the client. The client has the responsibility of filteringfor messages about which it cares. acpid will not close the clientsocket except in the case of a SIGHUP or acpid exiting.

For faster startup, this socket can be passed in as stdin so that acpidneed not create the socket. In addition, if a socket is passed in as stdin, acpid will not daemonize. It will be run in foreground. This behavior is provided to support systemd(1).

acpidwill log all of its activities, as well as the stdout and stderr of anyactions, to syslog.

All the default files and directories can be changed with commandline options.

OPTIONS

-c, --confdir directory
This option changes the directory in which acpid looks for ruleconfiguration files. Default is /etc/acpi/events.
-C, --clientmax number
This option changes the maximum number of non-root socket connections whichcan be made to the acpid socket. Default is 256.
-d, --debug
This option increases the acpid debug level by one. If the debug levelis non-zero, acpid will run in the foreground, and will log tostderr, in addition to the regular syslog.
-e, --eventfile filename
This option changes the event file from which acpid reads events.Default is /proc/acpi/event.
-n, --netlink
This option forces acpid to use the Linux kernel input layer and netlink interface for ACPI events.
-f, --foreground
This option keeps acpid in the foreground by not forking at startup.
-l, --logevents
This option tells acpid to log information about all events and actions.
-L, --lockfile filename
This option changes the lock file used to stop event processing.Default is /var/lock/acpid.
-g, --socketgroup groupname
This option changes the group ownership of the UNIX domain socket to whichacpid publishes events.
-m, --socketmode mode
This option changes the permissions of the UNIX domain socket to whichacpid publishes events. Default is 0666.
-s, --socketfile filename
This option changes the name of the UNIX domain socket which acpid opens.Default is /var/run/acpid.socket.
-S, --nosocket filename
This option tells acpid not to open a UNIX domain socket. Thisoverrides the -s option, and negates all other socket options.
-p, --pidfile filename
This option tells acpid to use the specified file as its pidfile. Ifthe file exists, it will be removed and over-written.Default is /var/run/acpid.pid.
-r, --dropaction action
This option defines the pseudo-action which tells acpid to abortall processing of an event, including client notifications.Default is <drop>.
-t, --tpmutefix
This option enables special handling of the mute button for certainThinkPad models with mute LEDs that get out of sync with the mute statewhen the mute button is held down. With this option, the mute buttonwill generate the following events in sync with the number of presses(and, by extension, the state of the LED):

button/mute MUTE (key pressed) K
button/mute MUTE (key released) K
-v, --version
Print version information and exit.
-h, --help
Show help and exit.

EXAMPLE

This example will shut down your system if you press the power button.

Create a file named /etc/acpi/events/power that contains the following:


event=button/power
action=/etc/acpi/power.sh "%e"

Then create a file named /etc/acpi/power.sh that contains the following:

/sbin/shutdown -h now "Power button pressed"

Now, when acpid is running, a press of the power button will cause therule in /etc/acpi/events/power to trigger the script in /etc/acpi/power.sh.The script will then shut down the system.

TROUBLESHOOTING

acpid is a simple program that runs scripts in response to ACPIevents from the kernel. When there's trouble, the problem is rarelywith acpid itself. The following are some suggestions forfinding the most common sources of ACPI-related problems.

When troubleshooting acpid, it is important to be aware that other partsof a system might be handling ACPI events.systemd(1) is capable of handling the power switch and various otherevents that are commonly handled by acpid. See the description ofHandlePowerKey in logind.conf(5) for more. Some window managers alsotake over acpid's normal handling of the power button and other events.

kacpimon(8) can be used to verify that the expected ACPI events arecoming in. See the man page for kacpimon(8) for the proper procedure.If the events aren'tcoming in, you've probably got a kernel driver issue.

If the expected events are coming in, then you'll needto check and see if your window manager is responsible forhandling these events. Some are, some aren't. (E.g. in Ubuntu14.04 (Unity/GNOME), there are settings for the laptop lid in theSystem Settings > Power > "When the lid is closed" fields.)If your window manager is responsible for handling the problematicevent, and you've got it configured properly, then you may have awindow manager issue.

Lastly, take a look in /etc/acpi/events (see above). Is therea configuration file in there for the eventin question (e.g. /etc/acpi/events/lidbtn for laptop lid open/closeevents)? Is it properly connected to ascript (e.g. /etc/acpi/lid.sh)? Is that script working? It's notunusual for an acpid script to check and see if there is a windowmanager running, then do nothing if there is. This means it is upto the window manager to handle this event.

DEPENDENCIES

acpid should work on any linux kernel released since 2003.

FILES

/proc/acpi/event
/dev/input/event*
/etc/acpi/
/var/run/acpid.socket
/var/run/acpid.pid
/var/lock/acpid

BUGS

There are no known bugs. To file bug reports, see PROJECT WEBSITE below.

SEE ALSO

regcomp(3), sh(1), socket(2), connect(2), init(1), systemd(1), acpi_listen(8), kacpimon(8)

PROJECT WEBSITE

http://sourceforge.net/projects/acpid2/

AUTHORS

Ted Felix <ted@tedfelix.com>
Tim Hockin <thockin@hockin.org>
Andrew Henroid

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLE
TROUBLESHOOTING
DEPENDENCIES
FILES
BUGS
SEE ALSO
PROJECT WEBSITE
AUTHORS
acpid linux command man page (2024)

FAQs

What is the acpid command in Linux? ›

Linux acpid command is an important tool for managing power and system events on your Linux system. It is essential for proper power management and handling system events such as shutting down, suspending, and restarting the system.

What is the command to show the man page in Linux? ›

Type ` man` followed by the command name to find its manual page. For example, ` man mkdir` will show you the manual page for the `mkdir` command. Using the ` -k` option: Want to search for keywords across all manual pages? Use man -k followed by your keyword(s).

What is the finger command in Linux man page? ›

The Linux finger command will display four pieces of information that can be changed by chfn: your real name, your work room and phone, and your home phone. Any of the four pieces of information can be specified on the command line. If no information is given on the command line, chfn enters interactive mode.

What is uptime command in Linux man page? ›

uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. This is the same information contained in the header line displayed by w(1).

How does the acpid command determine what action to take? ›

When an event occurs, the acpid daemon uses a set of rules defined in its configuration files to determine what action to take in response to the event. The rules are written in a simple scripting language and define the conditions that must be met for a particular action to be taken.

How to check system Linux command? ›

To check the current OS version in Linux, open the command line and use one of the commands like “cat /etc/os-release”, “lsb_release -a”, “hostnamectl”, or “uname -r”.

How do I navigate to man pages in Linux? ›

Navigating With Shortcut Keys

If we add a number before j, we move forward by that number of lines, e.g., 6j takes us six more lines ahead. pressing k to move us back one line. Similarly, if we enter a number with k, it takes us back to that number of lines.

How do I search for a man page in Linux? ›

On most Linux systems, the default pager used by man is less . If that is the case, you can search in a man page using the / (slash) key followed by a query (here -X ) and finally hit ENTER .

Where are the man pages located in Linux? ›

The manual pages are stored in /usr/share/man.

What is the 3 finger gesture in Linux? ›

With 3-finger gestures 'freed up' they can be used for different actions:
  • 3-finger swipe left/right switches apps on active workspace.
  • 3-finger push up on the touchpad maximizes window in focus.
  • 3-finger pull down and hold enters gesture window tiling mode.
Jan 3, 2023

What is the replacement for finger in Linux? ›

It is similar to the finger tool but in many Linux, Systems pinky comes pre-installed while finger doesn't, so this command is useful in case you don't have the right to install a program. Unlike finger, in the pinky, you may trim the information of your interest.

What is the man page command in Linux? ›

man command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS and SEE ALSO.

How to check uptime in Linux command? ›

Using the /proc/uptime command

You can also read the /proc/uptime file to get the system uptime. /proc is a virtual or pseudo-filesystem, also known as a process information pseudo-filesystem. It contains information about the system and the processes it's currently running.

How do I run uptime command? ›

Use the “systeminfo” command in the Command Prompt to find out the system uptime on Windows 10 or 11. This command will provide you with a detailed list of system details, including the “System Boot Time” that provides the information you need.

What is the Netdiag command in Linux? ›

The netdiag command is used to get a set of ENC-specific diagnostics. This option attempts to resolve the given name to an ENC address. This option prints a summary output of the configuration and status of the local ENC components.

How to use SNMP command in Linux? ›

How to enable SNMP on Linux
  1. Installation. $ sudo apt-get update $ sudo apt-get install snmpd.
  2. Configuration. Edit the file: /etc/snmp/snmpd. conf with a text editor of your choice. Add the following line: rocommunity public.

How to get process by command in Linux? ›

List Linux Processes Using ps Command. The Linux ps command creates a snapshot of the currently running processes. Unlike the other commands on this list, ps presents the output as a static list that is not updated in real time.

How to do checksum on Linux? ›

LINUX:
  1. Open a terminal window.
  2. Type the following command: md5sum [type file name with extension here] [path of the file] -- NOTE: You can also drag the file to the terminal window instead of typing the full path.
  3. Hit the Enter key.
  4. You'll see the MD5 sum of the file.
  5. Match it against the original value.
Nov 7, 2023

Top Articles
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6310

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.