郁闷,为什么在rc.local中添加stty命令不起作用

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
chang
钛 Ti
帖子: 26
注册时间: 2011-03-17 9:10

郁闷,为什么在rc.local中添加stty命令不起作用

帖子 chang » 2012-03-29 11:59

最近根据老板要求,我在rc.local中加入:/bin/stty -f /dev/tty00 clocal cs8 ixon ixoff,在root用户登录后这个命令是验证正确的,为什么在rc.local中不起作用?:confused:

头像
acheng
锌 Zn
帖子: 581
注册时间: 2011-07-07 21:52

回复: 郁闷,为什么在rc.local中添加stty命令不起作用

帖子 acheng » 2012-03-29 21:03

chang 写了:在root用户登录后这个命令是验证正确的,为什么在rc.local中不起作用?:confused:
你是说,root用户登录后运行这个命令没有问题,但是把这个命令放到rc.local文件中不起作用?

chang
钛 Ti
帖子: 26
注册时间: 2011-03-17 9:10

回复: 郁闷,为什么在rc.local中添加stty命令不起作用

帖子 chang » 2012-03-30 10:20

acheng 写了:你是说,root用户登录后运行这个命令没有问题,但是把这个命令放到rc.local文件中不起作用?
对啊,用其他用户登录也可以,放在rc.local中不能用

头像
acheng
锌 Zn
帖子: 581
注册时间: 2011-07-07 21:52

回复: 郁闷,为什么在rc.local中添加stty命令不起作用

帖子 acheng » 2012-03-30 14:25

我的 =猜测= 是,rc.local文件的执行发生在所有的terminal初始化(系统运行getty)之前,所以里面的命令不起作用。可以参考 init手册

同样根据从init手册中的下面这一段,可以考虑一下有没有可能修改/etc/ttys文件,将你的参数传给getty。
In multi-user operation, init maintains processes for the terminal ports
found in the file ttys(5). init reads this file, and executes the
command found in the second field. This command is usually getty(8);
getty opens and initializes the tty line and executes the login program.
The login program, when a valid user logs in, executes a shell for that
user.
注意:我对系统的terminal这一块不熟悉,以上意见仅供参考

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 25 访客