[Lunar-commits] CVS: moonbase/filesys/devfsd/init.d devfsd, NONE, 1.1

Auke Kok sofar at lunar-linux.org
Sat Jan 3 21:50:02 GMT 2004


Update of /var/cvs/lunar/moonbase/filesys/devfsd/init.d
In directory dbguin.lunar-linux.org:/tmp/cvs-serv19727/devfsd/init.d

Added Files:
	devfsd 
Log Message:
Moving into filesys


--- NEW FILE: devfsd ---
#!/bin/bash

DEVFSD=/sbin/devfsd

# This is now started in mount script, because of problems

start () {
  exit 0
}

stop () {
  echo -n "Stopping devfsd"
  PID=$(pidof devfsd)

  if [ -n "$PID" ] ; then
    kill -s 9 $PID					&&
    echo -e $RESULT_OK					||
    echo -e $RESULT_FAIL
  else
    echo -e $RESULT_FAIL
  fi
}

restart () {

  MNT=$(cat /proc/mounts | grep -v "usbdevfs"  |  grep "devfs" | awk '{ print $2 } ;')

  PID=$(pidof devfsd)

  if [ -n "$PID" ] ; then
    echo -n "Stopping devfsd"
    kill -s 3 $PID					&&
    echo -e $RESULT_OK					||		
    echo -e $RESULT_FAIL
  fi
  
  echo -n "Starting devfsd"
  $DEVFSD  $MNT &> /dev/null				&&
  echo -e $RESULT_OK					||
  echo -e $RESULT_FAIL 
}

status () {

  MNT=$(cat /proc/mounts | grep -v "usbdevfs"  |  grep "devfs" | awk '{ print $2 } ;')

  if [ -n "$MNT" ] ; then
    echo "devfs is mounted under: $MNT"
  else
    echo "devfs is not mounted"
  fi

  PID=$(pidof devfsd)
	
  if [ -n "$PID" ] ; then
    echo "devfsd is running as pid: $PID"
  else  
    echo "devfsd is not running"
  fi
}

case $1 in
   start|stop|restart|status) ;;
   *)     echo "Usage: $0 {stop|restart|status}"; exit 1  ;;
esac

. /lib/lsb/init-functions



More information about the Lunar-commits mailing list