1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon
Sebastiaan van Stijn 1262c57714
Skip empty directories on prior graphdriver detection
When starting the daemon, the `/var/lib/docker` directory
is scanned for existing directories, so that the previously
selected graphdriver will automatically be used.

In some situations, empty directories are present (those
directories can be created during feature detection of
graph-drivers), in which case the daemon refuses to start.

This patch improves detection, and skips empty directories,
so that leftover directories don't cause the daemon to
fail.

Before this change:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, aufs; Please cleanup or explicitly choose storage driver (-s <DRIVER>)

With this patch applied:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    INFO[2017-11-16T17:26:43.207739140Z] Docker daemon                                 commit=ab90bc296 graphdriver(s)=overlay2 version=dev
    INFO[2017-11-16T17:26:43.208033095Z] Daemon has completed initialization

And on restart (prior graphdriver is still picked up):

    $ dockerd
    ...
    INFO[2017-11-16T17:27:52.260361465Z] [graphdriver] using prior storage driver: overlay2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-21 15:42:04 +01:00
..
caps Copy Inslice() to those parts that use it 2017-11-10 13:42:38 +08:00
cluster Cancelation errors should not be logged 2017-11-14 20:32:20 -05:00
config Remove deprecated support for duplicate label-keys 2017-11-12 03:11:37 +01:00
discovery
events
exec Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
graphdriver Skip empty directories on prior graphdriver detection 2017-11-21 15:42:04 +01:00
initlayer Remove solaris files 2017-10-24 15:39:34 -04:00
links
listeners Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
logger Merge pull request #35073 from mle-ii/master 2017-11-08 14:53:56 -08:00
names
network
stats Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
testdata
apparmor_default.go
apparmor_default_unsupported.go
archive.go
archive_tarcopyoptions.go
archive_tarcopyoptions_unix.go
archive_tarcopyoptions_windows.go
archive_unix.go
archive_windows.go
attach.go
auth.go
bindmount_unix.go
build.go
cache.go
changes.go
checkpoint.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
cluster.go
commit.go Remove solaris files 2017-10-24 15:39:34 -04:00
configs.go
configs_linux.go
configs_unsupported.go
configs_windows.go
container.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
container_linux.go
container_operations.go
container_operations_unix.go
container_operations_windows.go
container_windows.go
create.go Set OS on scratch image and prevent panic if empty 2017-11-06 18:22:15 -08:00
create_unix.go
create_windows.go
daemon.go Increase container default shutdown timeout on Windows 2017-10-23 10:31:31 -07:00
daemon_experimental.go
daemon_linux.go
daemon_linux_test.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
daemon_test.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
daemon_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
daemon_unix_test.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
daemon_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
daemon_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
daemon_windows_test.go
debugtrap_unix.go
debugtrap_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
debugtrap_windows.go
delete.go Merge pull request #34999 from kolyshkin/wait-on-rm 2017-10-29 11:04:41 -07:00
delete_test.go
dependency.go
disk_usage.go
errors.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
events.go
events_test.go
exec.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_solaris.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
export.go
getsize_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
health.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
health_test.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
image.go
image_delete.go
image_exporter.go
image_history.go
image_inspect.go
image_pull.go
image_push.go
image_tag.go
images.go
import.go
info.go
info_unix.go Use containerd API to get version 2017-11-03 01:46:58 +01:00
info_unix_test.go
info_windows.go
inspect.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
inspect_solaris.go
inspect_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
inspect_windows.go
keys.go
keys_unsupported.go
kill.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
links.go
list.go
list_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
list_windows.go
logdrivers_linux.go
logdrivers_windows.go
logs.go Move json log reading into log file object 2017-11-04 08:31:58 -04:00
logs_test.go
metrics.go
metrics_unix.go
metrics_unsupported.go
monitor.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_solaris.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
mounts.go
names.go
network.go Remove solaris files 2017-10-24 15:39:34 -04:00
oci_linux.go Merge pull request #35316 from kolyshkin/facepalm 2017-11-14 11:13:59 +01:00
oci_windows.go
pause.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
prune.go
reload.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
reload_test.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
rename.go
resize.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
restart.go
search.go
search_test.go
seccomp_disabled.go
seccomp_linux.go
seccomp_unsupported.go
secrets.go
secrets_linux.go
secrets_unsupported.go
secrets_windows.go
selinux_linux.go
selinux_unsupported.go
start.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
start_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
start_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
stats.go Remove solaris files 2017-10-24 15:39:34 -04:00
stats_collector.go
stats_unix.go
stats_windows.go
stop.go
top_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
top_unix_test.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
top_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
trustkey.go
trustkey_test.go
unpause.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update_solaris.go
update_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
volumes.go
volumes_unit_test.go
volumes_unix.go Merge pull request #34224 from estesp/no-chown-nwfiles-outside-metadata 2017-11-02 15:00:42 -07:00
volumes_unix_test.go
volumes_windows.go
wait.go
workdir.go