Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: Roberto A. Foglietta on April 06, 2009, 05:45:49 AM

Title: shutdown or reboot
Post by: Roberto A. Foglietta on April 06, 2009, 05:45:49 AM
I use this cmdline parameters

Code: [Select]
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

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: [Select]
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 ""
Title: Re: shutdown or reboot
Post by: Roberto A. Foglietta on April 06, 2009, 06:08:43 AM
updated the code: killall5 -9 works better.  ;D