Check-in [e74499f8f4]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


SHA1 Hash:e74499f8f4a6675a7fce4b610c317991aa25b7e3
Date: 2012-05-14 03:13:00
User: BarryK
Comment:shinobar, Karl Godt: some precautions at shutdown

Tags And Properties

Changes to woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown

@@ -66,10 +66,11 @@
 #120219 zekebaby: unmount network shares, alternate method. 120220 another alternate method.
 #120409 experimenting with minit, i discovered "rm -rf /tmp/*" is killing mingetty. initrd.gz wipes it, have added code to wipe for full hd install at bootup...
 #120427 01micko: support ext4 save-file.
 #120514 WARNING: i don't have this problem, as no longer deleting /tmp/* (120409), however Karl Godt reported that 'fuser -k -m' may kill rc.shutdown then if no /tmp/bootcnt.txt then X restarts, ref:
 #120514 Karl Godt: 1st shutdown: test save-file mounted rw, not ro.
+#120514 shinobar: avoid killing this script.
 . /usr/bin/ # enables use of eval_gettext (several named variables) and ngettext (plurals)
 export TEXTDOMAIN=rc.shutdown
@@ -578,18 +579,22 @@
 #note, there is a problem with unmounting, especially ntfs as it cannot be remounted
 #ro (?). A ntfs part with ${DISTRO_FILE_PREFIX}save.2fs cannot be unmounted because of the mounted
 #at least, attempt to kill anything running in the ntfs partition...
 #(i don't think anything will be, only /dev/loop1 (${DISTRO_FILE_PREFIX}save.2fs), but just in case)
+MYPID=$$ #120514
+PARENT=$PPID #120514 id of parent process. variable provided by system.
 ABSPUPHOME="" #100107
 [ "$PUP_HOME" ] && ABSPUPHOME="/initrd${PUP_HOME}" #v2.16rc
 [ ! "$ABSPUPHOME" ] && ABSPUPHOME="/initrd/mnt/dev_save" #v2.16rc
 if [ "`busybox mount | grep "$ABSPUPHOME"`" != "" ];then
  #BADPIDS="`fuser -v -m $ABSPUPHOME | grep -v --extended-regexp 'kernel|COMMAND|^$' | tr -s ' ' | cut -f 3 -d ' ' | tr '\n' ' '`"
  BADPIDS="`fuser -m $ABSPUPHOME 2>/dev/null`" #100107
+  [ "$ONEBAD" = "$MYPID" ] && continue #120514 precaution.
+  [ "$ONEBAD" = "$PARENT" ] && continue #120514 precaution.
   #echo "`eval_gettext \"Killing process \\\${ONEBAD}...\"`"
   echo "Killing process $ONEBAD..."
   kill $ONEBAD
   sleep 1
   kill -9 $ONEBAD 2>/dev/null