我的服务器closures。 在午夜加class。
acpi事件power_button被触发。 在/ etc / acpi / events / power_button
电源button:
# care about the power button event=button/power.* action=/usr/lib/acpid/power_button
我怎样才能找出这个事件的“调用者”或触发器?
power_button是一个脚本,所以你只需要从该脚本中保存执行的回溯。 这个想法是编写一个脚本,从发起的power_button向上分析进程树,调用者进程应该在某处。
看到这个答案 。 将脚本放到/usr/lib/acpid/power_button ,并将其输出保存到一个文件中:除非原因不是数据中心的干净人员:)
完全取决于你的linux的风格,但我发现这在过去有帮助:
/var/log/acpi.log
还使用“lastcomm”来查找前面的过程。