How to kill a reborn init process in linux

am respawning / bin / bash on ttyS1 port.ttyS0 is my console. inittab input is below.

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

My question is how to disable / kill resuming so that I can use the serial port for other applications.

+4
source share
3 answers

You can kill this bash process, like other processes. However, init immediately resumes it - nothing happens.

To disable the process, you need to edit / etc / inittab and comment on this line. To report init about the change, you should send a SIGHUP to init: kill -HUP pid-of-init. (I think pid-of-init is always 1).

If you need your bash connected to ttyS1, in some cases you may need to specify certain runlevels at which init should start with bash.

Hope this answer helps ... (see man inittabfor more information)

+4
source

On my Ubuntu, this is what worked for me:

sudo rm -f /etc/init/<proc_name>.conf
sudo initctl stop <proc_name>

He returned the message:

initctl: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

but the process was stopped in any case without respawn.

+4
source

inittab , . /etc/inittab :

# init q

# telinit q

, .

+1

All Articles