Tiny Core Base > TCB Bugs

shutdown or reboot

(1/1)

Roberto A. Foglietta:
I use this cmdline parameters


--- Code: ---tc@box:~$ cat /proc/cmdline
BOOT_IMAGE=tinycore rw root=802 irqpoll idebus=66 ide_generic.probe_mask=0x0 rw local=sda2 home=sda2 tce=sda2 max_loop=128

--- End code ---

During shutdown or reboot /home/tc would be used by some processes and umount fails.
Please include this /etc/rc.d/rc.shutdown because it solves and it is nicer:


--- Code: ---tc@box:~$ cat /etc/init.d/rc.shutdown
#!/bin/sh
# /etc/init.d/rc.shutdown - used by /etc/inittab to shutdown the system.
#
. /etc/init.d/tc-functions

clear && sleep 1

# Sync all filesystems.
echo "${BLUE}Syncing all filesystems..."
sync; sleep 1; sync; sleep 1

if ! checkbootparam "noswap"; then
   echo "${BLUE}Disabling swap space..."
   /sbin/swapoff -a 2>/dev/null
fi

# Kill all processes.
echo "${YELLOW}Killing all processes..."
killall5 && sleep 2
echo "${RED}Terminating all processes..."
killall5 -9
echo -n "${NORMAL}"

# Umount filesystems.
echo "${BLUE}Unmounting all filesystems... "
echo -n "${NORMAL}"

if [ -s /opt/.tce_dir ]; then
   TCE=$(cat /opt/.tce_dir)
   TCEMOUNT=${TCE%/*}
   [ -z "$TCEMOUNT" ] || umount "$TCEMOUNT" 2>/dev/null
fi

if [ -s /opt/.backup_device ]; then
   BACKUP=`cat /opt/.backup_device`
   BACKUPDEVICE=/mnt/${BACKUP%/*}
   /bin/umount "$BACKUPDEVICE" 2>/dev/null
fi

/bin/umount -arf

echo -n "Shutdown in progress..."
usleep_progress
echo ""

--- End code ---

Roberto A. Foglietta:
updated the code: killall5 -9 works better.  ;D

Navigation

[0] Message Index

Go to full version