Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 7c04032173419e75c44b73346a9f91d0 > files > 5

devfsd-1.3.25-39mdk.i586.rpm

#!/bin/sh
#
# xfs:       Run the devfsd actions
#
# Version:      @(#) /etc/rc.d/init.d/devfsd 1.4
#
# chkconfig: 2345 99 10
# description: Cleaunup dynamic desktop directories and call devfsd actions.
#
# processname: devfsd
# config: /etc/devfsd.conf

# Source function library.
. /etc/rc.d/init.d/functions

subsys=/var/lock/subsys/devfsd

reload ()
{	# Restart devfsd actions now that the filesystems are ready
	if [ -c /dev/.devfsd ]; then
		if [ -x /sbin/devfsd ]; then
			[[ -e $subsys ]] && return
			# cleanup dynamic desktop directories before calling devfsd actions
			rm -f /usr/share/gnome/desktop/*_dynamic.desktop /usr/share/apps/kdesktop/Desktop/*_dynamic.desktop
			pid=`pidof devfsd`	
			[[ -z $pid ]] && return
			action "Running devfsd actions: " kill -HUP $pid

			# We don't want to run this on random runlevel changes.
			touch $subsys
		fi
	fi
}

start ()
{
	# conditionally start devfsd if devfs is mounted
	if [ -c /dev/.devfsd ]; then
		action "Starting devfsd daemon: " /sbin/devfsd /dev
	else
		passed "Starting devfsd daemon: "
	fi
}

stop ()
{	
      killproc devfsd
      action "Stopping devfsd daemon: " rm -f $subsys
}

# See how we were called.
case "$1" in
  start)
  	if test "x`pidof devfsd`" != x
	then reload
	else start
	fi
	;;
  stop)
	stop
	;;
  status)
  	status devfsd
	;;
  restart)
	stop
	start
	;;
  reload)
	rm -f $subsys
	reload
	;;
  *)
	gprintf "*** Usage: devfsd {start|stop|status|restart|reload}\n"
	exit 1
esac

exit 0