ACPI - What would be the best way to install it?

Dietpi doesn’t come with ACPI (Advanced Configuration and Power Interfac) tools installed.

What would be the best way to install it?

THX

Use systemd-logind which is present anyway, just masked by default. It requires dbus however:

systemctl unmask systemd-logind
apt install dbus
systemctl start dbus
systemctl start systemd-logind
1 Like

Hi @MichaIng

Thanks. I did get this information from a very friendly person in the Roon forum

apt -y install acpi

After that, create a folder for acpi event configuration files like so:

mkdir -p /etc/acpi/events/

Next create a file for the power button event:

sudo touch /etc/acpi/events/power_button

Finally write to the file using the following command

cat < /etc/acpi/events/power_button
event=button/power PBTN 00000080 00000000
action=/sbin/poweroff
EOF

and reboot the machine to apply the changes.

Does that look right?

THX

acpid would be the alternative:

apt install acpi-support-base

But systemd-logind is anyway needed for certain software and features, like X/desktops, Kodi, … so there are some mechanisms which enable it anyway where needed. So unless it remains a headless server system, and you do not intend to install any GUI applications, you could end up with two services providing the same functionality. But yeah, if really only ACPI is needed, and nothing logind otherwise provides, acpid is a little lighter.

EDIT: AFAIK simple power button functionality works OOTB, no need to configure anything manually. Yeah, the package acpi-support-base pulled in as dependncy provides /etc/acpi/events/powerbtn-acpi-support already.

EDIT2: Ah, acpi-support-base is not dependency, just a recommendation, which depends hard on acpid instead. So I adjusted the command above to install acpi-support-base instead.

THX. It is a headless system where Roon is running.

My concern is using the power button to turn it off. Right now I use DietPi Dashboard to turn the unit off. But that is not very convenient

Yeah okay, generally either of both works, acpi-support-base being the somewhat lighter standalone implementation with power button included. Not sure whether this or logind are aware of each other and avoid running ACPI event actions concurrently, so just keep in mind that, if systemd-logind is needed, or unmasked/started after a dietpi-software installation or dietpi-config step, you can, maybe should uninstall acpi-support-base again.

1 Like

THX for all your help.

If I understand you right, this would be OK?

No, skip all that, instead only:

apt install acpi-support-base

Nothing else, it includes the power button trigger.

1 Like

Thanks @MichaIng for your help.

Two small questions:

1: Can there be BIOS settings for any power management options that might conflict?

Currently I have activated “Deep Power Saving Mode” to make sure that my OWC Express 1M2 also is turned off, when turning off the NUC. But that is the only thing that I have changed

2: If something goes wrong?

How to stop it or remove the package?

Thanks and have a nice week. It is going to be hot in Hamburg (Germany)

Torben

Sometimes there is a setting to disable ACPI. Otherwise I am not aware of something which could conflict with it.

There is not really something which could go wrong. If ACPI events are triggered, the ACPI daemon will perform the respective action, else not. But in case you want to temporarily test whether stopping the daemon has an effect or not, control it with systemctl:

systemctl stop acpid
systemctl start acpid

Or uninstall the APT package the usual way:

apt autopurge acpi-support-base

autopurge also removes all otherwise not needed dependencies which were pulled in.

Then you can try systemd-logind as alternative as suggested above: ACPI - What would be the best way to install it? - #2 by MichaIng

1 Like

THANKS @MichaIng - Great support.

I will install it tomorrow

Torben

1 Like

So, has been installed: