cvs commit: LFS/bootscripts/contrib/init.d hotplug

winkie at linuxfromscratch.org winkie at linuxfromscratch.org
Tue Jun 15 09:11:09 PDT 2004


winkie      04/06/15 10:11:09

  Modified:    bootscripts/contrib/init.d hotplug
  Log:
  Clean-up hotplugging script
  
  Revision  Changes    Path
  1.4       +14 -8     LFS/bootscripts/contrib/init.d/hotplug
  
  Index: hotplug
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/contrib/init.d/hotplug,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- hotplug	3 Jun 2004 01:59:32 -0000	1.3
  +++ hotplug	15 Jun 2004 16:11:09 -0000	1.4
  @@ -7,28 +7,34 @@
   . $rc_functions
   
   # Exit quietly if you do not have hotplug installed
  -if [ ! -x /sbin/hotplug ]; then
  -	exit 0
  -fi
  +[ -x /sbin/hotplug ] || exit 0
   
   case "$1" in
  -	start|restart|status)
  -		# Set hotplug as the default manager of hotplug events
  -		echo /sbin/hotplug > /proc/sys/kernel/hotplug
  -
  +	start|restart)
   		echo "Loading modules for system devices..."
   		for rc in /etc/hotplug/*.rc; do
   			$rc $1
   		done
   		print_status success
  +
  +		# Set hotplug as the default manager of hotplug events
  +		echo /sbin/hotplug > /proc/sys/kernel/hotplug
   		;;
   	stop)
  +		# Remove hotplug as the default manager of hotplug events
  +		echo /bin/true > /proc/sys/kernel/hotplug
  +
   		echo "Unloading modules for system devices..."
   		for rc in /etc/hotplug/*.rc; do
  -			$rc $1
  +			$rc stop
   		done
   		print_status success
   		;;
  +	status)
  +		for rc in /etc/hotplug/*.rc; do
  +			$rc status
  +		done
  +		;;
   	*)
   		echo "Usage: $0 {start|stop|restart|status}"
   		exit 1
  
  
  



More information about the lfs-book mailing list