Artificial intelligent assistant

Which daemon or Linux command makes init 0 or shutdown happen when I press the power button? When I press the power button, Linux goes to init 0 (or shutdown clean). In the old times (2003) I had to configure acpid to give the shutdown function to the power button. Today on Slackware-current I did: cat `/etc/apci/event/default` #event=button power.* #action=/sbin/init 0 and I see the function is commented with # which mean disabled. So the question is: which daemon provides the init 0 function when I press the power button? Other distributrion mnay have systemd, but on Slackware we don't have systemd. Is it acpid even though the power button lines are commented?

Solution found. The acpi power button on Slackware, is managed by acpid daemon, is easy to test: I have booted a vm with acpid disabled and when I press the power button nothing happen. The power button init-0-way is configured by default, on old distros I have to edit it manually, now is enabled by default but you can configure /etc/acpi/events/default (or another name by your choose) to configure this "way" in another manor. For example if I want a different message from shutdown command I create a file


vim /etc/acpi/events/myway


with those contents


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


and finally I create the script /etc/acpi/button.sh with this content


/sbin/shutdown -h now "My message"


I restart acpid and work


/etc/rc.c/rc.acpid restart

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fd807cea5a17b18569b419cd20340962