zoukankan      html  css  js  c++  java
  • centos 6 initctl

    在centos6中有initctl 可以启动tty等。此命令在 upstart-0.6.5-10.el6.x86_64 rpm包中

          或者 mingetty 命令启动 tty    

          #initctl start tty TTY=/dev/tty6

    在centos7已经没有此命名及相应的rpm包。

         应该是通过 agetty命令启动tty,  util-linux-2.23.2-26.el7.x86_64  

        agetty    alternative Linux getty, agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by

    init(8).

        启动  #agettty tty2

       

    centos 7 下使用systemd-getty-generator 生成更多的tty

      systemd-getty-generator — Generator for enabling getty instances on the console    

         file: /usr/lib/systemd/system-generators/systemd-getty-generator

         

    centos 7 下tty相关的systemd 服务

      console-getty.service     disabled
      container-getty@.service    static
      getty@.service         enabled
      serial-getty@.service      disabled
      getty.target           static

          

          利用 systemctl mask 屏蔽服务

    for i in {4..6}; do
      systemctl mask getty@tty${i}.service
    done

        修改 /etc/systemd/logind.conf 文件中

          #NAutoVTs=6

      #ReserveVT=6

       可以屏蔽屏蔽掉后面的,如设置为1 和 0. 但我们使用的是tty2. tty1无法屏蔽掉

       

    待学习:

          1. 此命令的功能;

          2. 此rpm中其他命令的功能

          3. 在centos7中的相应功能

          4. 如何修改centos控制台上的标题

          5. 修改/etc/systemd/logind.conf 中 NAutoVTs=0, ReserveVT=0 都能看到前两个tty

  • 相关阅读:
    ElasticSearch记录(1)底层原理
    hbase学习记录(4)hbase和Hadoop整合(实现wrodcount程序)
    flume记录(2)监控文件和目录,对hdfs操作
    flume记录(1)使用
    hbase学习记录(3)JAVA_API操作hbase
    hbase学习记录(2)shell常用命令
    hbase学习记录(1)简介
    ssh三大框架整合
    spring事务管理
    Ubuntu 18.04版本设置root账户
  • 原文地址:https://www.cnblogs.com/doscho/p/6053269.html
Copyright © 2011-2022 走看看