[root@nginx etc]#
ps -aux | grep tty
1636 0.0 0.0 4056 552 tty2 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty2
root 1638 0.0 0.0 4056 548 tty3 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty3
root 1640 0.0 0.0 4056 548 tty4 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty4
root 1642 0.0 0.0 4056 552 tty5 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty5
root 1648 0.0 0.0 4056 552 tty6 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty6
root 1723 0.0 0.1 108328 1776 tty1 Ss+ 09:07 0:00 -bash
root 2344 0.0 0.0 103244 840 pts/0 S+ 10:29 0:00 grep tty
[root@nginx etc]#
vi /etc/init/start-ttys.conf
# This service starts the configured number of gettys.
start on stopped rc RUNLEVEL=[2345]
env ACTIVE_CONSOLES=/dev/tty
[1-2] #将tty[1-6]修改为[1-2] env X_TTY=/dev/tty1
task
script
. /etc/sysconfig/init
for tty in $(echo $ACTIVE_CONSOLES) ; do
[ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
initctl start tty TTY=$tty
done
end script
[root@nginx etc]#
vi /etc/sysconfig/init
# What ttys should gettys be started on?
ACTIVE_CONSOLES=/dev/
tty[1-2] #将tty[1-6]修改为[1-2]
#
Set to '/sbin/sulogin' to prompt for password on single-user mode
# Set to '/sbin/sushell' otherwise
SINGLE=/sbin/sushell
修改以上配置文件需重启系统生效,如果要临时停止tty终端,可使用 如:
initctl stop tty TTY=/dev/tty6 [停止tty6]。
[root@nginx etc]# ps -aux |grep tty
See /usr/share/doc/procps-3.2.8/FAQ
root 1636 0.0 0.0 4056 552 tty2 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty2
root 1638 0.0 0.0 4056 548 tty3 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty3
root 1640 0.0 0.0 4056 548 tty4 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty4
root 1642 0.0 0.0 4056 552 tty5 Ss+ 09:07 0:00 /sbin/mingetty /dev/tty5
root 1723 0.0 0.1 108328 1776 tty1 Ss+ 09:07 0:00 -bash
root 2358 0.0 0.0 103244 844 pts/0 S+ 10:31 0:00 grep tty
阅读(2772) | 评论(0) | 转发(0) |