Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] when the system does not boot...  (Read 9479 times)

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.846
[EN] when the system does not boot...
« on: 2014/05/10, 23:00:41 »
Siduction/Debian has a rescue tool that is not very well known. It comes with systemd and is called debug-shell.service. It allows you to open a rescue shell on tty 9 if you have problems with booting your system. The service file is preinstalled, but not activated. So to be able to use it in case you need it, you should activate it now:
Code: [Select]
systemctl enable debug-shell.serviceThe system will set a symbolic link:
Code: [Select]
ln -s '/lib/systemd/system/debug-shell.service' '/etc/systemd/system/sysinit.target.wants/debug-shell.service'
Now you can at any time open a shell with CTL ALT 9 and try to debug what is wrong by checking the status of services, reading logs, looking for stuck jobs with systemctl list-jobs etc. As long as GRUB starts, you can also add
Code: [Select]
debug-shell.service to the kernel boot line.


Offline ReinerS

  • User
  • Posts: 1.061
Re: when the system does not boot...
« Reply #1 on: 2014/05/10, 23:11:20 »
Great, I will surely give it a try.


slackware => SuSE => kanotix => sidux => aptosid  => siduction

Offline GoinEasy9

  • User
  • Posts: 564
Re: when the system does not boot...
« Reply #2 on: 2014/05/11, 00:11:42 »
Wow, this is interesting, nice feature.
Linux Counter number 348347

Offline musca

  • User
  • Posts: 725
  • sid, fly high!
Re: when the system does not boot...
« Reply #3 on: 2014/05/21, 15:43:42 »
Hello devil, GoinEasy9
yes, interesting, but the 'debug-shell.service' parameter set in grub's kernel cmdline doesn't give me the shell.

I learned from der_bud that  'systemd.unit=emergency.target'  enters maintenance mode.
While on it you can also add 'systemd.show_status=true' for traditional [ok] or [failed] messages.

So one can enable the debug-shell in maintenance mode:
Code: [Select]
mount -o remount,rw /
systemctl enable debug-shell.service
mount -o remount,ro /

« Last Edit: 2014/05/21, 15:53:26 by musca »
β€žEs irrt der Mensch, solang er strebt.β€œ  (Goethe, Faust)

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.367
    • Land of the Buckeye
Re: when the system does not boot...
« Reply #4 on: 2014/05/21, 20:03:58 »
This is interesting -- I just enabled it.

System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO


  • Guest
Re: when the system does not boot...
« Reply #5 on: 2014/05/21, 22:10:08 »
yes, good to know and beter to have in case.

Offline der_bud

  • User
  • Posts: 1.074
  • member
Re: when the system does not boot...
« Reply #6 on: 2014/05/22, 07:35:34 »
Please let me add a warning to all of this. It really is a nice feature to add this debug-shell when you have plans to investigate something on your system, then do as devil described. In case of emergency or boot problems, you can activate it like musca posted. But please consider to disable that shell again when you are done with testing it, otherwise your system has on tty9 an always enabled root shell without password, which might be considered as a vulnerability.

Quote from: http://freedesktop.org/wiki/Software/systemd/Debugging/ :
"Warning: Use this shell only for debugging! Do not forget to disable systemd-debug-shell.service after you've finished debugging your boot problems. Leaving the root shell always available would be a security risk."

On that site http://freedesktop.org/wiki/Software/systemd/Debugging/ is a lot more interesting stuff to read about bootproblems, debugging systemd, emergency.target and rescue.target and such.
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.