1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/etc/rc.d/ttys
Mike Makonnen 7a34a70b8d tty whacking should occur early, but not so early that the
required commands are not on a mounted file system.

Noticed by: bde
2003-07-30 18:53:59 +00:00

52 lines
928 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: ttys,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
# $FreeBSD$
#
# PROVIDE: tty
# REQUIRE: root mountcritremote
# BEFORE: SERVERS
# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
name="ttyflags"
start_cmd="ttyflags_start"
stop_cmd=":"
ttyflags_start()
{
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
}
load_rc_config $name
run_rc_command "$1"