Project

General

Profile

Actions

Bug #1047

closed

rcK shutdown gets hung

Added by Hammel about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
04 - Root File System
Target version:
Start date:
11 Oct 2023
Due date:
% Done:

100%

Estimated time:
Severity:
03 - Medium

Description

Running reboot will call /etc/init.d/rcK because of the shutdown config in inittab.

But rcK gets hung on something. Add debug code to it and run it manually to see what's hanging it.

Actions #1

Updated by Hammel about 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

First problem: rcK runs the list in the wrong order. It should run them in reverse numeric order. This can be fixed by listing the files and then reverse sorting with "sort -r".

Second problem: it gets stuck shutting down the network.

$ /etc/init.d/rcK
Splash framebuffer: 0
/etc/init.d/S01logging: line 14: Stopping logging: : not found
/etc/init.d/S01logging: line 17: OK: not found
Stopping syslogd: OK
Stopping klogd: FAIL
1+0 records in
1+0 records out
32 bytes (32B) copied, 0.000244 seconds, 128.1KB/s
Stopping system message bus: killall: dbus-daemon: no process killed
done
Stopping rpcbind daemon: OK
Stopping cron.
stopped process in pidfile '/var/run/crond.pid' (pid 725)
Stopping iptables: OK
Stopping network...

This eventually kicked me out, but the system was still running - I was in musicfe and was able to hit keys and have it respond. If I then exited musicfe, the launcher displayed but eventually keyboard input was lost. Eventually keyboard input came back and I could move around the launcher interface. When I tried to use Ctrl-T to get a terminal, it locked up again. Eventually keyboard came back again. This time I tried to select terminal app. Same lockup problem.

I'm going to implement the reverse order shutdown first, then try and see where it stops.

Actions #2

Updated by Hammel about 1 year ago

Now it looks like this from the ssh console:

$ /etc/init.d/rcK
Shutting down SMB services: OK
Shutting down NMB services: OK
Stopping PiBox Daemon...OK
Stopping Bluetooth daemon bluetoothd...
killall: bluetoothd: no process killed
Shutting down NFS mountd: OK
Shutting down NFS daemon: OK
Shutting down NFS services: OK
Stopping NFS statd: OK
Stopping ALSA...
Stopping lighttpd: OK
Stopping dropbear sshd: OK
Stopping ntpd: OK
Stopping network...

But since ssh was killed, that doesn't tell me what I need to know. So I need to run this from the target system directly, redirecting output to persistent storage.

Actions #3

Updated by Hammel about 1 year ago

  • % Done changed from 10 to 80

Well, now it looks fine.

$ cat rck.log
Shutting down SMB services: OK
Shutting down NMB services: OK
Stopping PiBox Daemon...OK
Stopping Bluetooth daemon bluetoothd...
Shutting down NFS mountd: OK
Shutting down NFS daemon: OK
Shutting down NFS services: OK
Stopping NFS statd: OK
Stopping ALSA...
Stopping lighttpd: OK
Stopping dropbear sshd: OK
Stopping ntpd: OK
Stopping network...
Stopping iptables: OK
Stopping cron.
stopped process in pidfile '/var/run/crond.pid' (pid 696)
Stopping rpcbind daemon: OK
Stopping system message bus: done
Stopping klogd: OK
Stopping syslogd: OK
Splash framebuffer: 0

Now when I run "reboot" manually it reboots nearly immediately. Just reversing the order appears to be the only fix required.

I will note that on the test target, a reboot happens quickly but the network is not bringing up eth0 on the next startup. This might be just this unit, however. Will test on other hardware.

Actions #4

Updated by Hammel about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

It's just that one. I'll deal with that later.

Code tested, committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF