Home | History | Annotate | Line # | Download | only in rc.d
ttys revision 1.6.50.1
      1       1.1     lukem #!/bin/sh
      2       1.1     lukem #
      3  1.6.50.1      yamt # $NetBSD: ttys,v 1.6.50.1 2013/01/16 05:26:14 yamt Exp $
      4       1.1     lukem #
      5       1.1     lukem 
      6       1.1     lukem # PROVIDE: tty
      7  1.6.50.1      yamt # REQUIRE: root bootconf
      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.6  christos 	if [ -c /dev/ttyp0 ]; then
     29       1.6  christos 		chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z]
     30       1.6  christos 	fi
     31       1.3     lukem 	#	only change ttyv* if ttyv0 is not reserved by a console.
     32       1.3     lukem 	#
     33       1.3     lukem 	if [ -c /dev/ttyv1 ]; then
     34       1.4     lukem 		chmod 666 /dev/ttyv[0-9a-zA-Z]
     35       1.3     lukem 	fi
     36       1.1     lukem }
     37       1.1     lukem 
     38       1.2     lukem load_rc_config $name
     39       1.1     lukem run_rc_command "$1"
     40