Hello,
I am currently trying to change where login is done in our system. This relates to the solution in a previous question of mine in https://www.toradex.com/community/questions/35597/jtag-dcchvc-console-colibri-imx6.html. The intention is that by default, when OS is started all serial port logins are disabled but our developer(s) can change this from u-boot prompt. I want the system to use only console(s) defined in kernel commandline and this would be changeable from u-boot environment.
I made the changes to system to use ttyUSB0 and everything works fine until I try to reboot. When I do this, the systemd hangs when it’s trying to close the getty service for console (console-getty.service), I think. Technically this is not a very critical issue because we do not use the reboot from command line except maybe if debugging the system. I still would prefer not to leave the cause unknown. My hunch is that I’ve done something wrong by changing the default packages (like remove getty-serial). Let me know if you require more info.
EDIT:
As a remark, I’ve disabled serial-getty@.service. The reason for this was that every ttyUSB interface aswell as ttymxc0 were enabled by default if plugged in at boot. The documentation (systemd-getty-generator) says that selected console is generated automatically but to me it didn’t always do that.
Below is what happens upon reboot.
# reboot
[ OK ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ OK ] Stopped target Sound Card.
Unmounting /Storage card...
[ OK ] Stopped target Graphical Interface.
[ OK ] Stopped target Multi-User System.
Stopping Avahi mDNS/DNS-SD Stack...
Stopping Timestamping service...
Stopping Save/Restore Sound Card State...
[ OK ] Stopped target Login Prompts.
Stopping Console Getty...
Hangup
[ OK ] Stopped target Timers.
[ OK ] Stopped Daily Cleanup of Temporary Directories.
Stopping Network Name Resolution...
Stopping Login Service...
[ OK ] Stopped Login Service.
[ OK ] Stopped Avahi mDNS/DNS-SD Stack.
[ OK ] Stopped Network Name Resolution.
[ 580.175072] INFO: task systemd:1 blocked for more than 10 seconds.
[ 580.175115] Not tainted 4.1.44-2.7.6+g18717e2 #22
[ 580.175126] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 580.175137] systemd D 80773758 0 1 0 0x00000000
[ 580.175157] Backtrace:
[ 580.175187] [<80773568>] (__schedule) from [<80773c94>] (schedule+0x44/0x9c)
[ 580.175198] r10:803c6910 r9:803c6bb4 r8:00000002 r7:8caab01c r6:8c060000 r5:7fffffff
[ 580.175228] r4:8c042000
[ 580.175246] [<80773c50>] (schedule) from [<80777dac>] (schedule_timeout+0x15c/0x19c)
[ 580.175256] r5:7fffffff r4:7fffffff
[ 580.175276] [<80777c50>] (schedule_timeout) from [<807783a4>] (down_write_failed+0xd0/0x1f0)
[ 580.175286] r9:803c6bb4 r8:00000002 r7:8caab01c r6:8c060000 r5:7fffffff r4:8caab018
[ 580.175319] [<807782d4>] (down_write_failed) from [<807787d0>] (ldsem_down_write+0x88/0xb4)
[ 580.175328] r8:7fffffff r7:803cef40 r6:00000001 r5:8caab050 r4:8caab018
[ 580.175368] [<80778748>] (ldsem_down_write) from [<803cef40>] (tty_ldisc_hangup+0xb0/0x1e8)
[ 580.175377] r8:8caab1b8 r7:807c3d18 r6:8caab018 r5:00000000 r4:8caab000
[ 580.175410] [<803cee90>] (tty_ldisc_hangup) from [<803c661c>] (__tty_hangup+0x278/0x3e0)
[ 580.175419] r7:807c3d18 r6:00000000 r5:8caab000 r4:8caab29c
[ 580.175448] [<803c63a4>] (__tty_hangup) from [<803c7acc>] (tty_ioctl+0xabc/0xc7c)
[ 580.175457] r10:00000000 r9:00000000 r8:8caab000 r7:7ed64fa5 r6:8cc90a00 r5:8caab000
[ 580.175486] r4:00005437
[ 580.175504] [<803c7010>] (tty_ioctl) from [<8011a038>] (do_vfs_ioctl+0x45c/0x670)
[ 580.175513] r9:8c042000 r8:00000032 r7:8011a288 r6:8cc90a00 r5:8c246060 r4:7ed64fa5
[ 580.175545] [<80119bdc>] (do_vfs_ioctl) from [<8011a288>] (SyS_ioctl+0x3c/0x64)
[ 580.175554] r10:00000000 r9:8c042000 r8:7ed64fa5 r7:00005437 r6:8cc90a00 r5:00000032
[ 580.175581] r4:8cc90a00
[ 580.175603] [<8011a24c>] (SyS_ioctl) from [<8000f920>] (ret_fast_syscall+0x0/0x3c)
[ 580.175612] r9:8c042000 r8:8000fac4 r7:00000036 r6:76f6cce8 r5:015e1be8 r4:015e0778
[ 580.175643] 2 locks held by systemd/1:
[ 580.175651] #0: (&tty->legacy_mutex){......}, at: [<8077913c>] tty_lock+0x60/0xb8
[ 580.175684] #1: (&tty->ldisc_sem){......}, at: [<803cef40>] tty_ldisc_hangup+0xb0/0x1e8
The backtrace part repeats in a loop every 10 seconds.
Additional info:
getty services:
# systemctl list-unit-files | grep getty
console-getty.service enabled
container-getty@.service static
getty@.service disabled
getty.target static
cmdline:
# cat /proc/cmdline
enable_wait_mode=off galcore.contiguousSize=50331648 ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fec_mac=00:14:2d:4d:bc:ca consoleblank=0 no_console_suspend=1 console=ttyUSB0,115200n8 video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 video=mxcfb1:off fbmem=8M
securetty:
# cat /etc/securetty
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
console
# Standard consoles
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
tty12
tty13
tty14
tty15
tty16
tty17
tty18
tty19
tty20
tty21
tty22
tty23
tty24
tty25
tty26
tty27
tty28
tty29
tty30
tty31
tty32
tty33
tty34
tty35
tty36
tty37
tty38
tty39
tty40
tty41
tty42
tty43
tty44
tty45
tty46
tty47
tty48
tty49
tty50
tty51
tty52
tty53
tty54
tty55
tty56
tty57
tty58
tty59
tty60
tty61
tty62
tty63
# Standard consoles, with devfs
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
vc/12
vc/13
vc/14
vc/15
vc/16
vc/17
vc/18
vc/19
vc/20
vc/21
vc/22
vc/23
vc/24
vc/25
vc/26
vc/27
vc/28
vc/29
vc/30
vc/31
vc/32
vc/33
vc/34
vc/35
vc/36
vc/37
vc/38
vc/39
vc/40
vc/41
vc/42
vc/43
vc/44
vc/45
vc/46
vc/47
vc/48
vc/49
vc/50
vc/51
vc/52
vc/53
vc/54
vc/55
vc/56
vc/57
vc/58
vc/59
vc/60
vc/61
vc/62
vc/63