WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: shutdown or reboot  (Read 2969 times)

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
shutdown or reboot
« 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 ""
« Last Edit: April 06, 2009, 06:09:29 AM by robang »

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: shutdown or reboot
« Reply #1 on: April 06, 2009, 06:08:43 AM »
updated the code: killall5 -9 works better.  ;D