Reboot Ubuntu if init daemon fails / systemd died

I got following error on an really badly "injured" Ubuntu machine:

Failed to start reboot.target: Failed to activate service 'org.freedesktop.systemd1': timed out
See system logs and 'systemctl status reboot.target' for details.
Failed to talk to init daemon.

Rebooting was not possible anymore, due to the beauty of 2933 zombie processes - slowing down the machine to a crawl.

However, this neat issue provided the answer to STILL get it to reboot:

# Reboot
sudo systemctl --force --force reboot
# Shutdown
sudo systemctl --force --force poweroff

"Cool", as Gregory House would say 😉

Lineage OS Fix: After reboot phone not usable anymore (Only back button/statusbar visible)

Sadly, my Nexus 4 (mako) had a rough experience after upgrading to Lineage OS: After a reboot, I ended up with this screen:

As you can see, only the back button and status bar are visible anymore, I can drag down the status bar and enable / disable stuff but cannot launch the settings or anything else - brick'd :(. I had to reinstall that thing several times, but then came to the conclusion what caused the error: I had enabled a screenlock (does not matter which kind :)) and played with the System Profile under Settings. I created a second System Profile which - as soon as it connected to my Home Wifi, removed the screenlock. And that was the problem. After two additional reboots, the error as seen manifested.

Good news: It only took me three complete reinstalls (read: wipe... ^^') to get that - and the fix is very simple: Don't create such an System profile. If you have and you end up there, that is no problem as well: If you have adb Debug enabled, you'll have it fixed in one minute and one reboot:

# open your CMD / Bash
adb shell
# activate root
su
# go to the correct folder
cd /data/system/
# get your current profile config
cat profiles.xml
# now grab that config file, remove the <profile> </profile>
# part which causes the error -> your newly created profile
# with "auto turnoff screenlock"
# after that, put it back on your phone
echo 'HERESHOULDBETHENEWCONFIG' > profiles.xml
# then reboot your phone
reboot

If you have no root access available you could get root on your device via the addon from Lineage OS, and if you don't want that (which is good too!) or you got no ADB Debug enabled - fix it from within TWRP :).

PS: If you want to report something, always pass along your logcat (extract with adb logcat -d '*:V' > logcat.txtif you got adb access)