CentOS 6.X 關閉不需要的 TTY 方法

[root@localhost ~]# ps aux | grep tty
root 1048 0.0 0.0 1980 484 tty1 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty1
root 1050 0.0 0.0 1980 484 tty2 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty2
root 1052 0.0 0.0 1980 484 tty3 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty3
root 1054 0.0 0.0 1980 484 tty4 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty4
root 1056 0.0 0.0 1980 480 tty5 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty5
root 1058 0.0 0.0 1980 476 tty6 Ss+ 04:49 0:00 /sbin/mingetty /dev/tty6root 1133 0.0 0.1 4328 728 pts/0 S+ 05:44 0:00 grep tty
[root@localhost ~]# vim /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]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

在打開 /etc/sysconfig/init

找到

ACTIVE_CONSOLES=/dev/tty[1-6]


修改爲:

ACTIVE_CONSOLES=/dev/tty[1-2]

重啓即可!

來源:http://www.linuxde.net/2012/01/7110.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章