[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Fedora 9 - Found bug on ACPI actions related with power off button



Hi all,

I found a little bug on acpi script that should check for the presence
of kpowersave or gnome-power-manager, before to issue the shutdown
command.

The script, located on /etc/acpi/action on fedora 9 use the awk command.

This is the peace of script that I think bugged

-- start code --
# Check that there is a power manager, otherwise shut down.
[ "$uid_session" ] &&                                      
ps axo uid,cmd | \                                         
awk '                                                      
    $1 == '$uid_session' &&                                
        ($2 == "gnome-power-manager" || $2 == "kpowersave") \
                { found = 1; exit }                          
    END { exit !found }                                      
' ||                                                         
  shutdown -h now
-- end code --

On my pc I have the shutdown .h now everytime I push the power button,
even if I configure it by kpowersave.

So I checked the 
 ps axo uid,cmd | grep kpowersave 
and I found 
     0 /usr/bin/kpowersave

so the awk command if everytime false
I would like if someone can check it and can confirm it's a bug.
I don't know well awk so I can had a mistake

Bye
 Ambrogio



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]