[PLUTO-help] HELp Il Pc non si spegne

Rudi rudixio a interfree.it
Mar 3 Ago 2004 17:58:58 CEST


Ho aggiunto ad halt.local all'ultima riga halt -p , il pc si spegne ma molto 
di scatto (mia impressione?) e se lancio un riavvio il pc si spegne...
Non so bene come compilare /etc/init.d/halt e /etc/init.d/halt.local per avere 
uno spegnimento normale e un riavvio normale provo a postare entrambi e spero 
qualcuno mi aiuti. Qualcuno che ha la suse 9.1 o 9.0 sarebbe cosė gentile di 
postamerli?

/etc/init.d/halt.local
#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany.  All rights reserved.
#
# Author: Werner Fink <werner a suse.de>, 1998
#         Burchard Steinbild, 1998
#
# /etc/init.d/halt.local
#
# script with local commands to be executed from init on system shutdown
#
# Here you should add things, that should happen directly before shuting
# down.
#


e /etc/default/halt

#! /bin/sh
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Florian La Roche, 1996
#	  Werner Fink <werner a suse.de>, 1996-2001
#
# Please send feedback to http://www.suse.de/feedback
#
# /etc/init.d/halt (and symlinked to reboot)
#

. /etc/rc.status
. /etc/sysconfig/clock
. /etc/sysconfig/suseconfig

#
# Avoid being interrupted by child or keyboard
#
trap "echo" SIGINT SIGSEGV SIGQUIT SIGTERM
set +e

rc_splash "reboot"

case "$0" in
	*halt)
		message="The system will be halted immediately."
		case `/bin/uname -m` in
                    i?86)
                        command="halt"
                        if test -e /proc/apm -o -e /proc/acpi -o 
-e /proc/sys/acpi ; then
                            command="halt -p"
                        else
                            read cmdline < /proc/cmdline
                            case "$cmdline" in
                                *apm=smp-power-off*|*apm=power-off*)  
command="halt -p" ;;
                            esac
                        fi
                        ;;
                    *)
                        command="halt -p"
                        ;;
                esac
		;;
	*reboot)
		message="Please stand by while rebooting the system..."
		command="reboot"
		;;
	*)
		echo "$0: call me as \"halt\" or \"reboot\" please!"
		exit 1
		;;
esac

#
# first do local stuff
#
rc_reset
test -e /etc/init.d/halt.local && {
    echo Running /etc/init.d/halt.local
    /bin/sh /etc/init.d/halt.local
    rc_status -v1 -r
}

# Write to wtmp file before unmounting /var
$command -w 

# Set a flag that we had success upto this point
> /success

# Stop blogd before umounting /var
test -x /sbin/blogd && killproc -QUIT /sbin/blogd

echo "Sending all processes the TERM signal..."
killall5 -15
echo -e "$rc_done_up"

sleep 1
test "$1" = "fast" -o -e /fastboot || sleep 4

echo "Sending all processes the KILL signal..."
killall5 -9
echo -e "$rc_done_up"

# Redirect our mesages to default console
test -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0

#
# call modules in boot.d via K* symlinks
# (reverse sequence)
#

if test -d /etc/init.d/boot.d/ ; then
    for i in /etc/init.d/boot.d/K*; do
        test -f $i || continue
        if test -x "$i" ; then
            # Active boot scripts, should have their own messages
            $i stop
        else
            # Old boot scripts, may not have any message
            echo Skipping $i, not executable
        fi
    done
fi

umount -anvt proc

# on umsdos fs this would lead to an error message, so direct errors to
# /dev/null
mount -no remount,ro / 2> /dev/null
sync

# Make reboot noise and wait a few seconds to give harddisks the chance
# to really flush their buffers before power goes down.
if test -n "$REDIRECT" ; then
    sleep 1
    case "$HALT_SOUND" in
    "yes"|"quint")
	echo -en "\033[10;393]\a\033[10;262]"
	sleep 1
	;;
    "octave")
	for tone in 524 491 440 393 349 328 295 ; do
	    echo -en "\033[10;${tone}]\a"
	    usleep 125000
	done
	echo -en "\033[10;262]"
	;;
    *)
    	echo -en "\033[10;440]\a"
	usleep 250000
	;;
    esac
else
    echo -en "\a"
    sleep 2
fi
echo $message
echo -en "\a"

# Set system console back to intial value
test -n "$REDIRECT" -a -n "$CONSOLE" && setconsole $REDIRECT < $CONSOLE

# Now talk to kernel
exec $command -d -f


Ciao 
Rudi


More information about the pluto-help mailing list