[laptop-mode] about laptop-mode

Bart Samwel bart at samwel.tk
Mon May 4 14:07:56 CEST 2009


Hi Ritesh,



Ritesh Raj Sarraf wrote:
> +check_acpid()
> +{
> +    # Check if acpid is running
> +    run=`pidof acpid`;
> +
> +    # Check if it is installed
> +    if [ -f /etc/init.d/acpid ]; then
> +        if [ -z $run ]; then
> +            log_daemon_msg "laptop-mode: Starting acpid"
> +            /etc/init.d/acpid start;
> +        else
> +            log_daemon_msg "laptop-mode: Reloading acpid"
> +            /etc/init.d/acpid reload;
> +        fi
> +    else
> +        log_failure_msg "laptop-mode: acpid not available"
> +    fi
> +}
> +
>  # Enable laptop mode when the system is booted when running on battery.
> 
>  case $1 in
>    start)
> +    check_acpid;
>      log_action_begin_msg "Enabling laptop mode"
>      mkdir -p /var/run/laptop-mode-tools
>      touch /var/run/laptop-mode-tools/enabled

AFAIK starting dependencies should be done by setting the startup number 
in rc2.d higher than the one of acpid; there's also dependency info at 
the top which is used by upstart. The reloading part is fine by me. :-)

Cheers,
Bart


More information about the laptop-mode mailing list