Systemd が再起動/シャットダウン時にハングします。ログは利用できません

Systemd が再起動/シャットダウン時にハングします。ログは利用できません

ログを取得できない場合、シャットダウン中に systemd を停止させているサービスがどれであるかをどのように判断すればよいでしょうか?

再起動またはシャットダウンしようとするたびに systemd がハングアップする原因を突き止めようと何日も苦労しています。シャットダウン プロセスは途中まで進みますが、完了しません。このシステムは、アクセス用にシリアル コンソールのみを備えたマシン上にあります。イーサネット ポートはありません。書き込み可能なディスクは RAM ドライブのみなので、再起動後に journalctl を調べても役に立ちません。

アーキテクチャは Arm64 上の Ubuntu 18.04 で、私が知っているのは次のことだけです。

[  OK          Stopping Session 3 of user root.
[  OK  ] Stopped target Timers.
[  OK  ] Stopped Daily apt upgrade and clean activities.
[  OK  ] Stopped Daily apt download activities.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
         Stopping Authorization Manager...
[  OK  ] Stopped Discard unused blocks once a week.
         Stopping Availability of block devices...
[  OK  ] Stopped target Graphical Interface.
         Stopping Disk Manager...
[  OK  ] Stopped target Multi-User System.
         Stopping strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf...
         Stopping System Logging Service...
[  OK  ] Stopped target Login Prompts.
         Stopping Getty on tty1...
         Stopping Serial Getty on ttyS0...
         Stopping Unattended Upgrades Shutdown...
         Stopping Dispatcher daemon for systemd-networkd...
         Stopping D-Bus System Message Bus...
         Stopping Chassis Fan Service...
         Stopping Regular background program processing daemon...
         Stopping OpenBSD Secure Shell server...
[  OK  ] Stopped Resets System Activity Data Collector.
         Stopping vsftpd FTP server...
         Stopping Nexcopy Graphical Interface...
[  OK  ] Stopped Nexcopy Gadget Service.
         Stopping LSB: Load kernel image with kexec...
         Stopping LSB: HPA's tftp server...
         Stopping User Manager for UID 0...
[  OK  ] Stopped target Host and Network Name Lookups.
         Stopping Getty on ttyGS0...
[  OK  ] Stopped Message of the Day.
         Stopping Network Name Resolution...
[  OK  ] Stopped Network Name Resolution.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped Dispatcher daemon for systemd-networkd.
[  OK  ] Stopped Disk Manager.
[  OK  ] Stopped strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf.
[  OK  ] Stopped Regular background program processing daemon.
[  OK  ] Stopped vsftpd FTP server.
[  OK  ] Stopped Unattended Upgrades Shutdown.
[  OK  ] Stopped Serial Getty on ttyS0.
[  OK  ] Stopped Nexcopy Graphical Interface.
[  OK  ] Stopped Getty on tty1.

ハングアップの原因となっているものは、おそらく次に試行されるサービスです。それが何であるかをどうやって判断すればよいでしょうか?

reboot -f は正常に動作するので、これはハードウェアの問題ではないことがわかります。

systemd に、停止しようとしているサービスに関するより詳細な情報を出力させる方法はありますか?

私は試した:

systemctl 再起動 --dry-run

何をしようとしていたのか教えてくれることを期待していましたが、どうやら --dry-run は無視され、いずれにしても実際のシャットダウン手順が開始されたようです。

systemd にタスク リストを出力させて、キューの次のタスクを確認する方法はありますか? アクセス用のシリアル コンソールが 1 つしかないため、他に何を試せばよいかわかりません。

誰か提案はありますか?

編集: これをもう一度見た後、1 つ疑問があります。このシステムの ttyS0 はコンソールであり、ログインしているポートです。メッセージが終了する直前に、このポートの getty が停止していることに気付きました。つまり、ログアウトしていると思われます。停止している getty によって、それ以上のデータが報告されない可能性がありますか? もしそうなら、これを回避する方法はありますか?

関連情報