Attachment 'initd_halt.patch'

Download

   1 --- etc/init.d/halt.orig	2010-07-20 10:12:40.398478867 -0400
   2 +++ etc/init.d/halt	2010-07-20 11:54:44.912625497 -0400
   3 @@ -129,94 +129,5 @@
   4  	;;
   5  esac
   6  
   7 -[ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
   8 -
   9 -# Try to unmount tmpfs filesystems to avoid swapping them in.  Ignore failures.
  10 -tmpfs=$(awk '$2 ~ /^\/($|proc|dev)/ { next; }
  11 -	     $3 == "tmpfs" { print $2; }' /proc/mounts | sort -r)
  12 -[ -n "$tmpfs" ] && fstab-decode $UMOUNT $tmpfs 2>/dev/null
  13 -
  14 -# Turn off swap, then unmount file systems.
  15 -[ -f /proc/swaps ] && SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`
  16 -if [ -n "$SWAPS" ]; then
  17 -    action $"Turning off swap: " swapoff $SWAPS
  18 -    for dst in $SWAPS; do
  19 -	if [[ "$dst" =~ "^/dev/mapper" ]] \
  20 -	    && [ "$(dmsetup status "$dst" | cut -d ' ' -f 3)" = crypt ]; then
  21 -	    backdev=$(/sbin/cryptsetup status "$dst" \
  22 -		| awk '$1 == "device:" { print $2 }')
  23 -	    /sbin/cryptsetup remove "$dst"
  24 -	fi
  25 -    done
  26 -fi
  27 -
  28 -[ -x /sbin/quotaoff ] && action $"Turning off quotas: " /sbin/quotaoff -aug
  29 -
  30 -# Unmount file systems, killing processes if we have to.
  31 -# Unmount loopback stuff first
  32 -__umount_loopback_loop
  33 -
  34 -# Unmount RPC pipe file systems
  35 -__umount_loop '$3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' \
  36 -    /proc/mounts \
  37 -    $"Unmounting pipe file systems: " \
  38 -    $"Unmounting pipe file systems (retry): " \
  39 -    -f
  40 -
  41 -LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next}
  42 -	$3 == "tmpfs" || $3 == "proc" {print $2 ; next}
  43 -	/(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next}
  44 -	{print $2}' /proc/mounts \
  45 -	$"Unmounting file systems: " \
  46 -	$"Unmounting file systems (retry): " \
  47 -	-f
  48 -
  49 -[ -f /proc/bus/usb/devices ] && $UMOUNT /proc/bus/usb
  50 -
  51 -[ -f /etc/crypttab ] && halt_crypto
  52 -
  53 -# remove the crash indicator flag
  54 -rm -f /.autofsck
  55 -
  56 -# Try all file systems other than root, essential filesystems and RAM disks,
  57 -# one last time.
  58 -awk '$2 !~ /\/(|dev|proc|selinux)$/ && $1 !~ /^\/dev\/ram/ { print $2 }' \
  59 -    /proc/mounts | sort -r | \
  60 -  while read line; do
  61 -    fstab-decode $UMOUNT -f $line
  62 -done
  63 -
  64 -if [ -x /sbin/halt.local ]; then
  65 -   /sbin/halt.local
  66 -fi
  67 -
  68 -# Remount read only anything that's left mounted.
  69 -# echo $"Remounting remaining filesystems readonly"
  70 -mount | awk '{ print $3 }' | while read line; do
  71 -    fstab-decode mount -n -o ro,remount $line
  72 -done
  73 -
  74 -# Now halt or reboot.
  75 -echo $"$message"
  76 -if [ -f /fastboot ]; then
  77 - echo $"On the next boot fsck will be skipped."
  78 -elif [ -f /forcefsck ]; then
  79 - echo $"On the next boot fsck will be forced."
  80 -fi
  81 -
  82 -if [ "$command" = /sbin/halt -a -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
  83 -	. /etc/sysconfig/ups
  84 -	if [ "$SERVER" = "yes" -a "$MODEL" = "upsdrvctl" ] ; then
  85 -		/sbin/upsdrvctl shutdown
  86 -	elif [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] ; then
  87 -		$MODEL $OPTIONS_HALT -k $DEVICE
  88 -	fi
  89 -fi
  90 -
  91 -# First, try kexec. If that fails, fall back to rebooting the old way.
  92 -[ -n "$kexec_command" ] && $kexec_command -e -x >& /dev/null
  93 -
  94 -HALTARGS="-d"
  95 -[ "$INIT_HALT" != "HALT" ] && HALTARGS="$HALTARGS -p"
  96 -
  97 -exec $command $HALTARGS
  98 +## JAIL - deleted all the unmount and actual halt stuff below here
  99 +echo "Shutdown complete."
 100 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-10-08T16:34:32+0000, 5.9 KB) [[attachment:centos5.5_bootstrap_rpm_list.txt]]
  • [get | view] (2010-10-08T17:33:30+0000, 3.2 KB) [[attachment:initd_halt.patch]]
  • [get | view] (2010-10-08T17:33:44+0000, 1.7 KB) [[attachment:initd_syslog.patch]]
  • [get | view] (2010-10-08T15:54:57+0000, 0.4 KB) [[attachment:linprocfs.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.