:: Re: [DNG] inittab getty tty
Top Pagina
Delete this message
Reply to this message
Auteur: mett
Datum:  
Aan: dng
Onderwerp: Re: [DNG] inittab getty tty
2016-09-24 12:53 に mett さんは書きました:
> 2016-09-23 23:56 に Rainer Weikusat さんは書きました:
>> mett <mett@???> writes:
>>
>> [...]
>>
>>
>>> I realized few days ago I had not any tty when the server comes up
>>> (and is up), while trying to set up a serial connection to this
>>> server:
>>>
>>> root@tamerrp:/home/mettler# ps aux | grep tty
>>> root 3560 0.0 0.0 12728 2284 pts/2 S+ 11:19 0:00 grep tty
>>>
>>> root@tamerrp:/home/mettler# dmesg | grep tty
>>> [0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64
>>> root=UUID=5982d543-1e27-4350-b2f2-81d0cc40e0a0 ro console=tty0
>>> console=ttyS0,9600n8
>>> [0.000000] Kernel command line:
>>> BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64
>>> root=UUID=5982d543-1e27-4350-b2f2-81d0cc40e0a0 ro console=tty0
>>> console=ttyS0,9600n8
>>> [0.000000] console [tty0] enabled
>>> [0.000000] console [ttyS0] enabled
>>> [8.132769] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is
>>> a 16550A
>>> [30.550283] ttyS1: LSR safety check engaged!
>>> [30.611799] ttyS1: LSR safety check engaged!
>>>
>>> (I can connect via ssh).
>>
>> The command-line you're booting with instructs the kernel to print
>> output on tty0 and ttyS0 but only accept input from ttyS0.
>
> Thanks for your answers.
> ttyS0 is not available as well.
> Once the system is booted, only ssh is available.
> (I don't have any problem at boot level, or even at BIOS level(it's an
> HP DL320 g5s)
> I can select kernel via graphical-console or serial-console, according
> to how I set /etc/default/grub, by the way.
> Right now I've defaulted everything, so I can only select kernel via
> graphical-console at boot level).
>
>>
>>> It seems init is not parsing /etc/inittab while starting up
>>> (init q seems wihtout effect as well).
>>
>> This seems very unlikely. In order to check for this, you could attach
>> an strace to init with
>>
>> strace -f -p 1
>>
>> [...]
> Here is the result of strace:
> ----------------------------------------------------------------------
> root@tamerrp:/home/mettler# strace -f -p 1
> Process 1 attached
> select(11, [10], NULL, NULL, {4, 999684}init q
> ) = 0 (Timeout)
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> fstat(10, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> select(11, [10], NULL, NULL, {5, 0})    = 0 (Timeout)
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> fstat(10, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> select(11, [10], NULL, NULL, {5, 0})    = 0 (Timeout)
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> fstat(10, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> stat("/run/initctl", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> select(11, [10], NULL, NULL, {5, 0}^CProcess 1 detached
>  <detached ...>
> ----------------------------------------------------------------------
> My goal is to boot with sysvinit.
> ----------------------------------------------------------------------
> root@tamerrp:/home/mettler# less /sbin/init
> [...]
> INIT_VERSION=sysvinit-2.88
> [...]
> ----------------------------------------------------------------------
> I think Ill try the init re-install path, installing another init 
> before.
> I started making a script calling getty from /etc/rc0.d or 
> /etc/rc.local,
> but, I finally think it's wiser to have sysvinit doing what it is
> expected to do.

>

Just an update
I re-installed sysvinit to no avail. While checking the log after that,
I saw that init q was working
----------------------------------------------------------------------
root@tamerrp:/home/mettler# grep inittab /var/log/syslog
Sep 24 10:04:38 tamerrp init: Re-reading inittab
----------------------------------------------------------------------
but still no luck with tty...
That's when I realized, by chance, that changing of running level would 
bring me the tty
----------------------------------------------------------------------
root@tamerrp:/home/mettler# init 3
root@tamerrp:/home/mettler# ps aux | grep tty
root      2384  0.0  0.0  14416  2016 tty1     Ss+  18:18   0:00 
/sbin/getty 38400 tty1
root      2385  0.0  0.0  14416  2156 tty2     Ss+  18:18   0:00 
/sbin/getty 38400 tty2
[...]
root      2392  0.0  0.0  12664  1912 ttyS0    Ss+  18:18   0:00 
/sbin/getty -L ttyS0 9600 vt100
root      2797  0.0  0.0  12728  2300 pts/0    S+   18:27   0:00 grep 
tty
----------------------------------------------------------------------
I tried to write an initscript to bring the system to init 3 then but 
didn't get any interesting results.
Finally, I found on the net you can setup a crontab starting with 
@reboot instead of mhdmd.
That did the trick. System is now initting to runlevel 2 then crontab 
call a script
that is '/sbin/init 3' to runlevel 3 where I get the tty.
I still don't know what is the origin of this behaviour though but I 
have a temporary solution at least!


HTH sby sday!