Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-release > by-pkgid > 1df9f03b3fdb3533663bd13d46c0b3d0 > files > 39

initscripts-8.99-6mdv2010.0.x86_64.rpm

#! /bin/bash

# Bring down all unneeded services that are still running (there shouldn't 
# be any, so this is just a sanity check)

case "$1" in
   *start)
	;;
   *)
	gprintf "Usage: %s {start}\n" $0
	exit 1
	;;
esac
				      

for i in /var/lock/subsys/* ; do
	# Check if the script is there.
	[ -f "$i" ] || continue

	# Get the subsystem name.
	subsys=${i#/var/lock/subsys/}
	
	# Networking could be needed for NFS root.
	[ $subsys = network ] && continue

	# Bring the subsystem down.
	if [ -f /etc/init.d/$subsys.init ]; then
		/etc/init.d/$subsys.init stop
	elif [ -f /etc/init.d/$subsys ]; then
		/etc/init.d/$subsys stop
	else
		rm -f "$i"
	fi
done