The officially official Devuan Forum!

You are not logged in.

#1 2023-09-08 10:28:00

bill.p
Member
Registered: 2023-07-01
Posts: 20  

[SOLVED] Action when power button is pressed

I'm currently building a digital organ using Devuan as the OS. I have arranged for the PC to be remotely powered on by wiring the front panel switch leads to a relay, activated by an Arduino. It works fine, but if the relay is activated a second time the PC immediately goes into shutdown. I've found references to using ACPID on Debian, and set that up, but it doesn't make any difference. How is the power button handled by Devuan?

Offline

#2 2023-09-08 12:40:12

bill.p
Member
Registered: 2023-07-01
Posts: 20  

Re: [SOLVED] Action when power button is pressed

Solved: /etc/elogind/logind.conf....

Offline

#3 2023-09-08 13:58:04

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 202  
Website

Re: [SOLVED] Action when power button is pressed

You posted this in "Documentation" section, which is intended as "How-tos and Tips & Tricks contributed by Devuan users", but didn't give details.

It may help others to be explicit about which of the various settings within logind.conf solved the problem?


3.1415P265E589T932E846R64338

Offline

#4 2023-09-08 15:54:54

bill.p
Member
Registered: 2023-07-01
Posts: 20  

Re: [SOLVED] Action when power button is pressed

Sorry!
/etc/elogind/logind.conf has an entry:
   #HandlePowerKey=shutdown
I uncommented the line and changed it to:
  HandlePowerKey=ignore

The elogind daemon looks after various things including users logging in and out, but also covers powering up and down.
Pressing the power button on a PC or the Power key on a laptop signals to the kernel and elogind handles it in whatever manner
you prefer. The default setting is to shutdown immediately, logging off any users. As my organ hides the power button and replaces
it with a relay, I have opted to avoid any unintended shutdowns by ignoring them.

Offline

Board footer