Help: errore in rc.0
Inviato: dom 13 giu 2004, 13:04
Salve a tutti,
<BR>non so cosa sia successo di preciso alla mia JoLinux (basata su Slack) ma non riesco più a spegnere il sistema.
<BR>Vi prego di aiutarmi poichè ora posso solo staccare la spina...
<BR>
<BR>L´errore riportato è:
<BR>rc.0 linea 46: killall not found
<BR> Nel file rc.0 alla linea 46 non c´è nessuna chiamata al comando killall
<BR>
<BR>Ho cercato il comando killall nel sistema e non l´ho trovato ( ci sono invece i comandi kill e killall5).
<BR>
<BR>Cosa può essere successo ?
<BR>Ho inavvertitamente cancellato il comando killall?
<BR>Ho modificato il file rc.0?
<BR>
<BR>Vi riporto il contenuto del file rc.0
<BR>
<BR>#! /bin/sh
<BR>#
<BR># rc.6 This file is executed by init when it goes into runlevel
<BR># 0 (halt) or runlevel 6 (reboot). It kills all processes,
<BR># unmounts file systems and then either halts or reboots.
<BR>#
<BR># Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001
<BR>#
<BR># Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org>
<BR># Modified by: Patrick J. Volkerding, <volkerdi@slackware.com>
<BR>#
<BR>
<BR># Set the path.
<BR>PATH=/sbin:/etc:/bin:/usr/bin
<BR>
<BR># If there are SystemV init scripts for this runlevel, run them.
<BR>if [ -x /etc/rc.d/rc.sysvinit ]; then
<BR> . /etc/rc.d/rc.sysvinit
<BR>fi
<BR>
<BR># Set linefeed mode to avoid staircase effect.
<BR>stty onlcr
<BR>
<BR>echo "Running shutdown script $0:"
<BR>
<BR># Find out how we were called.
<BR>case "$0" in
<BR> *0)
<BR> command="halt"
<BR> ;;
<BR> *6)
<BR> command=reboot
<BR> ;;
<BR> *)
<BR> echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
<BR> exit 1
<BR> ;;
<BR>esac
<BR>
<BR># Save the system time to the hardware clock using hwclock --systohc.
<BR># Detect SGI Visual Workstation, since hwclock will make those freeze up:
<BR>if fgrep -l Cobalt-APIC /proc/interrupts 1> /dev/null 2> /dev/null ; then
<BR> echo "SGI Visual Workstation detected. Not running hwclock."
<BR>elif [ -x /sbin/hwclock ]; then
<BR> if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then
<BR> echo "Saving system time to the hardware clock (UTC)."
<BR> /sbin/hwclock --utc --systohc
<BR> else
<BR> echo "Saving system time to the hardware clock (localtime)."
<BR> /sbin/hwclock --localtime --systohc
<BR> fi
<BR>fi
<BR>
<BR># Stop the Apache web server:
<BR>if [ -x /etc/rc.d/rc.httpd ]; then
<BR> /etc/rc.d/rc.httpd stop
<BR>fi
<BR>
<BR># Stop the MySQL database:
<BR>if [ -r /var/run/mysql/mysql.pid ]; then
<BR> . /etc/rc.d/rc.mysqld stop
<BR>fi
<BR>
<BR># Stop the Samba server:
<BR>if [ -x /etc/rc.d/rc.samba ]; then
<BR> . /etc/rc.d/rc.samba stop
<BR>fi
<BR>
<BR># Shut down the NFS server:
<BR>if [ -x /etc/rc.d/rc.nfsd ]; then
<BR> /etc/rc.d/rc.nfsd stop
<BR>fi
<BR>
<BR># Unmount any NFS or SMB filesystems:
<BR>echo "Unmounting remote filesystems."
<BR>umount -a -r -t nfs,smbfs
<BR>
<BR># Try to kill dhcpcd so the DHCP leases can be returned:
<BR>killall -15 dhcpcd 1> /dev/null 2> /dev/null
<BR>
<BR># Shut down PCMCIA devices:
<BR>if [ -x /etc/rc.d/rc.pcmcia ] ; then
<BR> . /etc/rc.d/rc.pcmcia stop
<BR> # The cards might need a little extra time here to initialize.
<BR> sleep 5
<BR>fi
<BR>
<BR># Turn off process accounting:
<BR>if [ -x /sbin/accton -a -r /var/log/pacct ]; then
<BR> echo "Turning off process accounting."
<BR> /sbin/accton
<BR>fi
<BR>
<BR># Kill all processes.
<BR># INIT is supposed to handle this entirely now, but this didn´t always
<BR># work correctly without this second pass at killing off the processes.
<BR># Since INIT already notified the user that processes were being killed,
<BR># we´ll avoid echoing this info this time around.
<BR>if [ "$1" != "fast" ]; then # shutdown did not already kill all processes
<BR> killall5 -15
<BR> sleep 5
<BR> killall5 -9
<BR>fi
<BR>
<BR># Try to turn off quota:
<BR>if fgrep quota /etc/fstab 1> /dev/null 2> /dev/null ; then
<BR> if [ -x /sbin/quotaoff ]; then
<BR> echo "Turning off filesystem quotas."
<BR> /sbin/quotaoff -a
<BR> fi
<BR>fi
<BR>
<BR># Before unmounting file systems write a reboot or halt record to wtmp.
<BR>$command -w
<BR>
<BR># Carry a random seed between reboots.
<BR># Save 512 bytes, which is the size of the entropy pool.
<BR>if [ ! -r /etc/random-seed ]; then
<BR> touch /etc/random-seed
<BR> chmod 600 /etc/random-seed
<BR>fi
<BR>echo "Saving random seed from /dev/urandom in /etc/random-seed."
<BR>dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
<BR>
<BR># Clear /var/lock/subsys.
<BR>if [ -d /var/lock/subsys ]; then
<BR> rm -f /var/lock/subsys/*
<BR>fi
<BR>
<BR># Turn off swap, then unmount local file systems.
<BR>echo "Turning off swap."
<BR>swapoff -a
<BR>echo "Unmounting local file systems."
<BR># Don´t remount UMSDOS root volumes:
<BR>if [ ! "`mount | head -1 | cut -d ´ ´ -f 5`" = "umsdos" ]; then
<BR> umount -a -r -t nonfs
<BR> echo "Remounting root filesystem read-only."
<BR> mount -n -o remount,ro /
<BR>else
<BR> umount -a -r -t nonfs,noumsdos,nosmbfs
<BR>fi
<BR>
<BR># This never hurts:
<BR>sync
<BR>
<BR># If we´re using LVM, we need to deactivate the volume groups:
<BR>if [ -r /etc/lvmtab ]; then
<BR> /sbin/vgchange -an
<BR>fi
<BR>
<BR># sleep 1 fixes problems with some hard drives that don´t
<BR># otherwise finish syncing before reboot or poweroff
<BR>sleep 1
<BR>
<BR># This is to ensure all processes have completed on SMP machines:
<BR>wait
<BR>
<BR>if [ -x /sbin/genpowerd ]; then
<BR> # See if this is a powerfail situation:
<BR> if egrep "FAIL|SCRAM" /etc/upsstatus 1> /dev/null 2> /dev/null ; then
<BR> # Signal UPS to shut off the inverter:
<BR> /sbin/genpowerd -k /dev/ttyS4 tripp-nt
<BR> if [ ! $? = 0 ]; then
<BR> echo
<BR> echo "There was an error signaling the UPS."
<BR> echo "Perhaps you need to edit /etc/rc.d/rc.6 to configure"
<BR> echo "the serial line and UPS type."
<BR> # Wasting 15 seconds of precious power:
<BR> sleep 15
<BR> fi
<BR> fi
<BR>fi
<BR>
<BR># Now halt (poweroff with APM kernels) or reboot.
<BR>if [ "$command" = "reboot" ]; then
<BR> echo "Rebooting."
<BR> reboot
<BR>else
<BR> poweroff
<BR>fi
<BR>
<BR>
<BR>
<BR>Grazie<br>
<BR>non so cosa sia successo di preciso alla mia JoLinux (basata su Slack) ma non riesco più a spegnere il sistema.
<BR>Vi prego di aiutarmi poichè ora posso solo staccare la spina...
<BR>
<BR>L´errore riportato è:
<BR>rc.0 linea 46: killall not found
<BR> Nel file rc.0 alla linea 46 non c´è nessuna chiamata al comando killall
<BR>
<BR>Ho cercato il comando killall nel sistema e non l´ho trovato ( ci sono invece i comandi kill e killall5).
<BR>
<BR>Cosa può essere successo ?
<BR>Ho inavvertitamente cancellato il comando killall?
<BR>Ho modificato il file rc.0?
<BR>
<BR>Vi riporto il contenuto del file rc.0
<BR>
<BR>#! /bin/sh
<BR>#
<BR># rc.6 This file is executed by init when it goes into runlevel
<BR># 0 (halt) or runlevel 6 (reboot). It kills all processes,
<BR># unmounts file systems and then either halts or reboots.
<BR>#
<BR># Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001
<BR>#
<BR># Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org>
<BR># Modified by: Patrick J. Volkerding, <volkerdi@slackware.com>
<BR>#
<BR>
<BR># Set the path.
<BR>PATH=/sbin:/etc:/bin:/usr/bin
<BR>
<BR># If there are SystemV init scripts for this runlevel, run them.
<BR>if [ -x /etc/rc.d/rc.sysvinit ]; then
<BR> . /etc/rc.d/rc.sysvinit
<BR>fi
<BR>
<BR># Set linefeed mode to avoid staircase effect.
<BR>stty onlcr
<BR>
<BR>echo "Running shutdown script $0:"
<BR>
<BR># Find out how we were called.
<BR>case "$0" in
<BR> *0)
<BR> command="halt"
<BR> ;;
<BR> *6)
<BR> command=reboot
<BR> ;;
<BR> *)
<BR> echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
<BR> exit 1
<BR> ;;
<BR>esac
<BR>
<BR># Save the system time to the hardware clock using hwclock --systohc.
<BR># Detect SGI Visual Workstation, since hwclock will make those freeze up:
<BR>if fgrep -l Cobalt-APIC /proc/interrupts 1> /dev/null 2> /dev/null ; then
<BR> echo "SGI Visual Workstation detected. Not running hwclock."
<BR>elif [ -x /sbin/hwclock ]; then
<BR> if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then
<BR> echo "Saving system time to the hardware clock (UTC)."
<BR> /sbin/hwclock --utc --systohc
<BR> else
<BR> echo "Saving system time to the hardware clock (localtime)."
<BR> /sbin/hwclock --localtime --systohc
<BR> fi
<BR>fi
<BR>
<BR># Stop the Apache web server:
<BR>if [ -x /etc/rc.d/rc.httpd ]; then
<BR> /etc/rc.d/rc.httpd stop
<BR>fi
<BR>
<BR># Stop the MySQL database:
<BR>if [ -r /var/run/mysql/mysql.pid ]; then
<BR> . /etc/rc.d/rc.mysqld stop
<BR>fi
<BR>
<BR># Stop the Samba server:
<BR>if [ -x /etc/rc.d/rc.samba ]; then
<BR> . /etc/rc.d/rc.samba stop
<BR>fi
<BR>
<BR># Shut down the NFS server:
<BR>if [ -x /etc/rc.d/rc.nfsd ]; then
<BR> /etc/rc.d/rc.nfsd stop
<BR>fi
<BR>
<BR># Unmount any NFS or SMB filesystems:
<BR>echo "Unmounting remote filesystems."
<BR>umount -a -r -t nfs,smbfs
<BR>
<BR># Try to kill dhcpcd so the DHCP leases can be returned:
<BR>killall -15 dhcpcd 1> /dev/null 2> /dev/null
<BR>
<BR># Shut down PCMCIA devices:
<BR>if [ -x /etc/rc.d/rc.pcmcia ] ; then
<BR> . /etc/rc.d/rc.pcmcia stop
<BR> # The cards might need a little extra time here to initialize.
<BR> sleep 5
<BR>fi
<BR>
<BR># Turn off process accounting:
<BR>if [ -x /sbin/accton -a -r /var/log/pacct ]; then
<BR> echo "Turning off process accounting."
<BR> /sbin/accton
<BR>fi
<BR>
<BR># Kill all processes.
<BR># INIT is supposed to handle this entirely now, but this didn´t always
<BR># work correctly without this second pass at killing off the processes.
<BR># Since INIT already notified the user that processes were being killed,
<BR># we´ll avoid echoing this info this time around.
<BR>if [ "$1" != "fast" ]; then # shutdown did not already kill all processes
<BR> killall5 -15
<BR> sleep 5
<BR> killall5 -9
<BR>fi
<BR>
<BR># Try to turn off quota:
<BR>if fgrep quota /etc/fstab 1> /dev/null 2> /dev/null ; then
<BR> if [ -x /sbin/quotaoff ]; then
<BR> echo "Turning off filesystem quotas."
<BR> /sbin/quotaoff -a
<BR> fi
<BR>fi
<BR>
<BR># Before unmounting file systems write a reboot or halt record to wtmp.
<BR>$command -w
<BR>
<BR># Carry a random seed between reboots.
<BR># Save 512 bytes, which is the size of the entropy pool.
<BR>if [ ! -r /etc/random-seed ]; then
<BR> touch /etc/random-seed
<BR> chmod 600 /etc/random-seed
<BR>fi
<BR>echo "Saving random seed from /dev/urandom in /etc/random-seed."
<BR>dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
<BR>
<BR># Clear /var/lock/subsys.
<BR>if [ -d /var/lock/subsys ]; then
<BR> rm -f /var/lock/subsys/*
<BR>fi
<BR>
<BR># Turn off swap, then unmount local file systems.
<BR>echo "Turning off swap."
<BR>swapoff -a
<BR>echo "Unmounting local file systems."
<BR># Don´t remount UMSDOS root volumes:
<BR>if [ ! "`mount | head -1 | cut -d ´ ´ -f 5`" = "umsdos" ]; then
<BR> umount -a -r -t nonfs
<BR> echo "Remounting root filesystem read-only."
<BR> mount -n -o remount,ro /
<BR>else
<BR> umount -a -r -t nonfs,noumsdos,nosmbfs
<BR>fi
<BR>
<BR># This never hurts:
<BR>sync
<BR>
<BR># If we´re using LVM, we need to deactivate the volume groups:
<BR>if [ -r /etc/lvmtab ]; then
<BR> /sbin/vgchange -an
<BR>fi
<BR>
<BR># sleep 1 fixes problems with some hard drives that don´t
<BR># otherwise finish syncing before reboot or poweroff
<BR>sleep 1
<BR>
<BR># This is to ensure all processes have completed on SMP machines:
<BR>wait
<BR>
<BR>if [ -x /sbin/genpowerd ]; then
<BR> # See if this is a powerfail situation:
<BR> if egrep "FAIL|SCRAM" /etc/upsstatus 1> /dev/null 2> /dev/null ; then
<BR> # Signal UPS to shut off the inverter:
<BR> /sbin/genpowerd -k /dev/ttyS4 tripp-nt
<BR> if [ ! $? = 0 ]; then
<BR> echo
<BR> echo "There was an error signaling the UPS."
<BR> echo "Perhaps you need to edit /etc/rc.d/rc.6 to configure"
<BR> echo "the serial line and UPS type."
<BR> # Wasting 15 seconds of precious power:
<BR> sleep 15
<BR> fi
<BR> fi
<BR>fi
<BR>
<BR># Now halt (poweroff with APM kernels) or reboot.
<BR>if [ "$command" = "reboot" ]; then
<BR> echo "Rebooting."
<BR> reboot
<BR>else
<BR> poweroff
<BR>fi
<BR>
<BR>
<BR>
<BR>Grazie<br>