2

My headless server has a power button.

When the user presses it, I want the server to respond with a brief beep, then shutdown the server.

The system should only beep when manually pressing the power button, not when the system shuts down on its own (e.g. when idle).

systemd handles the ACPI event from the power button, but how can I add a beep to HandlePowerKey there?

hez
  • 181

1 Answers1

0

this question was solved here: https://unix.stackexchange.com/q/1974

you just need to add that command like

echo -e "\a"

to execution of power button event.

it uses "beep" package, so you should install it before

sudo apt-get install beep

  • Thanks, but I know how to make the beep. What I don't know is how to make systemd emit a beep when the power button is pressed. The solution you link to is not for systemd. – hez Jul 07 '15 at 14:02