Home | History | Annotate | Line # | Download | only in rc.d
      1 #!/bin/sh
      2 #
      3 # $NetBSD: clearcritlocal,v 1.3 2020/09/08 12:52:18 martin Exp $
      4 #
      5 
      6 # REQUIRE: mountcritlocal
      7 # BEFORE: CRITLOCALMOUNTED
      8 
      9 $_rc_subr_loaded . /etc/rc.subr
     10 
     11 name="clearcritlocal"
     12 start_cmd="clearcritlocal_start"
     13 stop_cmd=":"
     14 
     15 clearcritlocal_start()
     16 {
     17 	#	clean up left-over files.
     18 	#	this could include the cleanup of lock files and /var/run, etc.
     19 	#
     20 	rm -f /etc/nologin /var/spool/lock/LCK.*
     21 	if [ -d /var/run ]; then
     22 		cd /var/run && rm -rf -- *
     23 	fi
     24 	return 0
     25 }
     26 
     27 load_rc_config $name
     28 run_rc_command "$1"
     29