Docker – Debian – Kernel panick – Automatic restart

Problem

You have a remote server (Debian) running some Docker containers and you want to make sure that they all restart in the event of a kernel panick.

solution

  • Add an automatic restart after a kernel panick by running:
    sysctl kernel.panic=20
  • Emulate a kernel panick by running the following (SysRq more info here :
    echo c > /proc/sysrq-trigger
  • Check that the containers have restarted again with docker ps (NOTE: the containers should have been enabled to autorestart)

failed to execute ‘/lib/udev/socket:@/org/freedesktop/hal/udev_event’ ‘socket:@/org/freedesktop/hal/udev_event’

Problem

Looking at your /var/log/syslog you see entries every few seconds like the following:

Mar  1 15:44:52 L530 systemd-udevd[11464]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Mar  1 15:44:52 L530 systemd-udevd[11451]: Process 'socket:@/org/freedesktop/hal/udev_event' failed with exit code 2.
Mar  1 15:44:54 L530 systemd-udevd[11479]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Mar  1 15:44:54 L530 systemd-udevd[11466]: Process 'socket:@/org/freedesktop/hal/udev_event' failed with exit code 2.

Solution

Seems that hal is not used in newer Ubuntu versions, so you can remove it:

sudo apt-get purge hal

Taken from the answer here