head	1.7;
access;
symbols
	RELENG_5_2_1_RELEASE:1.4
	RELENG_5_2_0_RELEASE:1.4
	RELENG_5_2:1.4.0.2
	RELENG_5_2_BP:1.4
	RELENG_5_1_0_RELEASE:1.3
	RELENG_5_1:1.3.0.4
	RELENG_5_1_BP:1.3
	RELENG_5_0_0_RELEASE:1.3
	RELENG_5_0:1.3.0.2
	RELENG_5_0_BP:1.3
	head_20020621:1.1.1.2
	head_20010615:1.1.1.1
	NETBSD:1.1.1;
locks; strict;
comment	@# @;


1.7
date	2004.02.07.07.10.25;	author mtm;	state dead;
branches;
next	1.6;

1.6
date	2004.01.17.10.59.43;	author mtm;	state Exp;
branches;
next	1.5;

1.5
date	2004.01.17.10.16.38;	author mtm;	state Exp;
branches;
next	1.4;

1.4
date	2003.07.30.18.53.59;	author mtm;	state Exp;
branches;
next	1.3;

1.3
date	2002.09.06.16.18.05;	author gordon;	state Exp;
branches;
next	1.2;

1.2
date	2002.06.13.22.14.36;	author gordon;	state Exp;
branches;
next	1.1;

1.1
date	2001.06.16.07.16.14;	author obrien;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.06.16.07.16.14;	author obrien;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2002.06.21.19.07.21;	author obrien;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Now that devfs is mandatory, there is no need to muck around
with tty/pty permissions.

Noticed by:	brooks
OKed:		phk
@
text
@#!/bin/sh
#
# $NetBSD: ttys,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
# $FreeBSD: src/etc/rc.d/ttys,v 1.6 2004/01/17 10:59:43 mtm Exp $
#

# PROVIDE: tty
# REQUIRE: root mountcritremote
# BEFORE:  SERVERS
# KEYWORD: FreeBSD

. /etc/rc.subr

name="ttyflags"
start_cmd="ttyflags_start"
stop_cmd=":"

ttyflags_start()
{
	# Whack the pty perms back into shape.
	#	XXX:	there may be more ptys than this; maybe use
	#		sysctl to find out how many?
	#
	if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
		chflags 0 /dev/tty[pqrsPQRS]*
		chmod 666 /dev/tty[pqrsPQRS]*
		chown root:wheel /dev/tty[pqrsPQRS]*
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.6
log
@Luke Mewburn has indicated that they (NetBSD) are not interested
in keeping the scripts under rc.d in sync with us. So, remove
NetBSD specific stuff (which made our scripts more complicated
than necessary).

The NetBSD ident string will be left intact, both for history and
also incase we wish to pull in future versions.
@
text
@d4 1
a4 1
# $FreeBSD$
@


1.5
log
@Luke Mewburn has indicated that they (NetBSD) are not interested
in keeping the scripts under rc.d in sync with us. So, begin removal
of NetBSD specific stuff (which made our scripts more complicated
than necessary), starting with the NetBSD KEYWORD.
@
text
@d20 9
a28 28
	case ${OSTYPE} in
	FreeBSD)

		# Whack the pty perms back into shape.
		#	XXX:	there may be more ptys than this; maybe use
		#		sysctl to find out how many?
		#
		if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
			chflags 0 /dev/tty[pqrsPQRS]*
			chmod 666 /dev/tty[pqrsPQRS]*
			chown root:wheel /dev/tty[pqrsPQRS]*
		fi
		;;
	NetBSD)
		#	set flags on ttys.
		#	(do early, in case they use tty for SLIP in network)
		#
		echo "Setting tty flags."
		ttyflags -a

		#	setup ptys
		#
		#	XXX:	there may be more ptys than this; maybe use
		#		sysctl to find out how many?
		#
		chmod 666 /dev/tty[pqrs]*
		;;
	esac
@


1.4
log
@tty whacking should occur early, but not so early that the
required commands are not on a mounted file system.

Noticed by: bde
@
text
@d10 1
a10 1
# KEYWORD: FreeBSD NetBSD
@


1.3
log
@Convert from `${CMD_OSTYPE}` to ${OSTYPE}. This saves a shell invocation on
OS-dependent case switches.
@
text
@d8 2
a9 1
# REQUIRE: root
@


1.2
log
@Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:	Mike Makonnen <makonnen@@pacbell.net>
Reviewed by:	silence on -current and -hackers
Prodded by:	rwatson
@
text
@d19 1
a19 1
	case `${CMD_OSTYPE}` in
@


1.1
log
@Initial revision
@
text
@d4 1
d9 1
d19 28
a46 12
	#	set flags on ttys.
	#	(do early, in case they use tty for SLIP in network)
	#
	echo "Setting tty flags."
	ttyflags -a

	#	setup ptys
	#
	#	XXX:	there may be more ptys than this; maybe use
	#		sysctl to find out how many?
	#
	chmod 666 /dev/tty[pqrs]*
@


1.1.1.1
log
@Import the NetBSD 1.5 RC system.

Note that `rc' and `rc.shutdown' could not be imported because we already
have files with those names.
@
text
@@


1.1.1.2
log
@Sync with NetBSD's mainline.
@
text
@d3 1
a3 1
# $NetBSD: ttys,v 1.3 2001/04/25 12:59:16 lukem Exp $
d26 1
a26 1
	#		sysctl kern.maxptys to find out how many?
d28 1
a28 7
	chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z]

	#	only change ttyv* if ttyv0 is not reserved by a console.
	#
	if [ -c /dev/ttyv1 ]; then
		chmod 666 /dev/ttyv[0-9a-zA-Z]
	fi
@

