Chinaunix首页 | 论坛 | 博客
  • 博客访问: 397914
  • 博文数量: 60
  • 博客积分: 1082
  • 博客等级: 上士
  • 技术积分: 648
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-24 18:24
个人简介

奋斗的人,交心的人,碰见喷子,绝对不手软。

文章分类
文章存档

2015年(1)

2014年(18)

2013年(17)

2012年(21)

2011年(3)

分类: LINUX

2012-10-23 17:54:10


[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
阅读(2718) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~