Docker service problems with USB external storage

Docker service problems with USB external storage

I have several services managed by Docker that use external USB storage, and I also have an fsck.service that runs at starting before being mounted by the system (before local-fs.target).

With the Docker image updates of this December, some or all have stopped working. To solve this problem I have had to add to /storage/.config/autostart.sh the following lines of code:

  MEDIA='/media/5TB-HDD'
  while [ ! -d "$MEDIA" ]; do
    sleep 10
  done
  systemctl restart service.system.docker

… and now everything works well again.

Does anyone know any more elegant method of solving this, for example by introducing additional conditions to the starts of the ‘Docker’ service?

Add here a path exist condition like ConditionPathExists?

Make a copy of this service file to /storage/.config/system.d and modify it for your needs.

1 Like