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

转载于:https://www.cnblogs.com/doscho/p/6053269.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值