getty hidden process

Grant Edwards grant.b.edwards at gmail.com
Wed Mar 22 14:53:05 UTC 2017


On 2017-03-22, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> On 2017-03-22, Lars Alex Pedersen <laa at kamstrup.com> wrote:
>> I'm pretty sure that the process must run somewhere I just can't locate it.
>> Reloading inittab with the getty line starts the serial command prompt but it
>> is not shown anywhere.
>
> If you've got a command prompt, then getty isn't running -- the shell is.
>
> If you've got a _login_ prompt, then getty is running.
>
>>  ps ax
>> PID   USER     TIME   COMMAND
>>     1 root       0:01 init
>>     2 root       0:00 [kthreadd]
>
>>   340 root       0:00 -sh
>
> Bingo.

Just to be clear: when you log in, the busybox getty exec()s the
shell.  The shell executable _replaces_ the getty exectuable in the
same process.  If you do a 'ps' command while the serial port is
showing the 'login:' prompt, you'll see a 'getty' process running.

After you log in on that serial port, you'll see a process named '-sh'
running with that same PID (that used to be the getty).  When the
shell exits, init will start a new 'getty'.

-- 
Grant Edwards               grant.b.edwards        Yow! It's a hole all the
                                  at               way to downtown Burbank!
                              gmail.com            



More information about the busybox mailing list