View Full Version : Chiudere macchina spegnendo con il tasto del pc.
Dcromato
21-10-2007, 17:56
Si puo fare sta cosa con Frugalware?con altr distro ci riesco tranquillamente....
jventure
21-10-2007, 19:53
/etc/acpi/events/powerbtn
# /etc/acpi/events/powerbtn
# This is called when the user presses the power button and calls
# /etc/acpi/powerbtn.sh for further processing.
# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.
# We need to react on "button power.*" and "button/power.*" because
# of kernel changes.
event=button[ /]power
action=/etc/acpi/stopbtn.sh
/etc/acpi/stopbtn.sh
#!/bin/sh
sudo halt
test -f /usr/share/acpi-support/power-funcs || exit 0
. /usr/share/acpi-support/key-constants
acpi_fakekey $KEY_STOPCD
la pressione del tasto genera un evento acpi di tipo powerbtn gestito dall'omonimo file in /etc/acpi/events che imposta i parametri di risposta all'evento.
Dcromato
21-10-2007, 20:16
Si puo fare anche in modo che lo spegnimento sia segnalato da un avviso?
jventure
21-10-2007, 22:35
tutto quello che metti in stopbtn.sh viene eseguito
puoi far inviare una mail con sendmail, mettere un messaggio in ogni tty ecc ...
è uno script sh quindi puoi programmarlo come vuoi.
alcune info sulla programmazione POSIX :
http://a2.pluto.it/a2172.htm#almltitle1018
http://a2.pluto.it/a2179.htm#almltitle1089
Dcromato
22-10-2007, 00:34
Grazie delle risposte.
A dire il vero non funziona.:stordita:
jventure
22-10-2007, 09:23
cosa vuoi fargli fare?
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.