如何通过在Linux的init杀重生过程 [英] How to kill respawned process by init in linux

查看:123
本文介绍了如何通过在Linux的init杀重生过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重生的就是ttyS1 port.ttyS0的/斌/ bash的是我的控制台。
inittab条目如下。

am respawning the /bin/bash on ttyS1 port.ttyS0 is my console. inittab entry is given below.

::重生:/斌/ bash的<为/ dev /就是ttyS1>的/ dev / 2就是ttyS1>的/ dev /就是ttyS1

::respawn:/bin/bash < /dev/ttyS1 > /dev/ttyS1 2> /dev/ttyS1

我的问题是如何禁用/杀respwning,这样我可以使用串口
对于其他的应用程序。

My question is how to disable/kill respwning so that i can use serial port for other application.

推荐答案

您可以杀死像其他流程,bash进程。但是,初始化立即重生之 - 。焉得虎子

You can kill that bash process like other processes. However, init respawns it immediately - nothing gained.

要禁用,你必须编辑/ etc / inittab文件,并注释掉该行的过程。
通知初始化这个变化,你必须发送一个SIGHUP来初始化:杀-HUP PID-的-INIT
(我认为的PID的-init始终1)。

To disable the process you have to edit /etc/inittab and comment out that line. To inform init about this change you have to send a SIGHUP to init: kill -HUP pid-of-init. (I think that pid-of-init is always 1).

如果您需要在bash的您可能要指定特定的运行级别中的init应该开始bash的某些情况下,连接到就是ttyS1。

If you need your bash connected to ttyS1 in some circumstances you may want to specify certain runlevels in which init should start bash.

希望这个答案可以帮助...(请参阅男人inittab文件了解更多信息)

Hope this answer helps... (see man inittab for further information)

这篇关于如何通过在Linux的init杀重生过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆