Linux Server won’t restart

By: Luke Rawlins Nov 14, 2017 | 2 minutes read
Share this:

Tags: CentOS, Failed to talk to init daemon, systemctl force reboot

Not too long ago I ran into a problem where a server with systemd would not shutdown or reboot through normal means.

When executing sudo shutdown -r now I would get a weird message back as output:

Failed to start reboot.target: Connection timed out
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.

I’m still not entirely certain what caused the problem and the suggestion of running systemctl status reboot.target to troubleshoot simply resulted in the same message being displayed.

However, if you run into this problem and you just need to get your services back up and running you can force a reboot like this:

Try this first:

systemctl --force reboot

If that doesn’t work, which it didn’t for me, add another –force but know that this will unceremoniously kill all running process.

systemctl --force --force reboot

This of course assumes that you can still gain access to the terminal via ssh. This operation is essentially the same as holding down the power button on a physical machine or hitting the reset button on a VM.

According to the man page this can dangerous if you have a process running that is trying to save data so be certain that you want to forcibly kill off every process on your server before running this command. Try it with only a single –force first.

Related Posts


RPM package queries

This post is just a quick walk-through of some basic commands to help you find information about rpm packages. These commands will work for any rpm based distribution (Red Hat, Centos, Suse, Mageia) Debian based distributions like Ubuntu or Mint use dpkg instead of rpm and I’ll cover those in a different post. Query the rpm database You can query the rpm database to find a particular installed package using the -q option. Read more

Command not found!

So you’re running through some instructions to configure software on your system, or troubleshoot some problem with a service and you see an error at the command line that says “command not found”. Here is how to locate the packages you need to install in order to use commands that are not available on your system. CentOS/Red Hat - yum provides Yum is an excellent package manager with lots of great built in functions. Read more

Find services that require a restart

Ubuntu offers a live patching utility that allows kernel patches to be installed without requiring a system restart to be applied. Read more about online patching in this post about patching. That said, in many cases other services or processes on your system may need to be restarted after an upgrade. Finding services that need to be restarted in Ubuntu Install debian-goodies sudo apt update sudo apt install debian-goodies Now just run Read more


Contact

If you’d like to get in touch, contact with me via email - or follow on Twitter.

[email protected]