Home | History | Annotate | Line # | Download | only in rc.d
      1 #!/bin/sh
      2 #
      3 # $NetBSD: wdogctl,v 1.4 2009/04/21 16:08:57 joerg Exp $
      4 #
      5 
      6 # PROVIDE: wdogctl
      7 # BEFORE:  fsck_root
      8 
      9 # The watchdog is configured VERY early, so that any problems that
     10 # occur during the bootstrap process are protected by the watchdog.
     11 
     12 $_rc_subr_loaded . /etc/rc.subr
     13 
     14 name="wdogctl"
     15 rcvar=$name
     16 
     17 start_cmd="watchdog_start"
     18 stop_cmd="watchdog_stop"
     19 status_cmd="watchdog_status"
     20 
     21 extra_commands="status"
     22 
     23 watchdog_start()
     24 {
     25 	if [ x"${wdogctl_flags}" = "x" ]; then
     26 		warn "\${wdogctl_flags} is not set, watchdog not started"
     27 	else
     28 		echo "Starting watchdog timer."
     29 		/sbin/wdogctl ${wdogctl_flags}
     30 	fi
     31 }
     32 
     33 watchdog_stop()
     34 {
     35 	echo "Stopping watchdog timer."
     36 	/sbin/wdogctl -d
     37 }
     38 
     39 watchdog_status()
     40 {
     41 	/sbin/wdogctl
     42 }
     43 
     44 load_rc_config $name
     45 run_rc_command "$1"
     46