Home | History | Annotate | Line # | Download | only in rc.d
ttys revision 1.5
      1  1.1    lukem #!/bin/sh
      2  1.1    lukem #
      3  1.5  mycroft # $NetBSD: ttys,v 1.5 2004/08/13 18:08:03 mycroft Exp $
      4  1.1    lukem #
      5  1.1    lukem 
      6  1.1    lukem # PROVIDE: tty
      7  1.1    lukem # REQUIRE: root
      8  1.1    lukem 
      9  1.5  mycroft $_rc_subr_loaded . /etc/rc.subr
     10  1.1    lukem 
     11  1.1    lukem name="ttyflags"
     12  1.1    lukem start_cmd="ttyflags_start"
     13  1.1    lukem stop_cmd=":"
     14  1.1    lukem 
     15  1.1    lukem ttyflags_start()
     16  1.1    lukem {
     17  1.1    lukem 	#	set flags on ttys.
     18  1.1    lukem 	#	(do early, in case they use tty for SLIP in network)
     19  1.1    lukem 	#
     20  1.1    lukem 	echo "Setting tty flags."
     21  1.1    lukem 	ttyflags -a
     22  1.1    lukem 
     23  1.1    lukem 	#	setup ptys
     24  1.1    lukem 	#
     25  1.1    lukem 	#	XXX:	there may be more ptys than this; maybe use
     26  1.3    lukem 	#		sysctl kern.maxptys to find out how many?
     27  1.1    lukem 	#
     28  1.4    lukem 	chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z]
     29  1.3    lukem 
     30  1.3    lukem 	#	only change ttyv* if ttyv0 is not reserved by a console.
     31  1.3    lukem 	#
     32  1.3    lukem 	if [ -c /dev/ttyv1 ]; then
     33  1.4    lukem 		chmod 666 /dev/ttyv[0-9a-zA-Z]
     34  1.3    lukem 	fi
     35  1.1    lukem }
     36  1.1    lukem 
     37  1.2    lukem load_rc_config $name
     38  1.1    lukem run_rc_command "$1"
     39