How to enable successful udev synchronization in docker?

I downloaded and installed the static linked docker 1.6.1 from this site and ran it on RHEL 7.1 :

 [ root@localhost bin]# ./docker -d WARN[0000] Udev sync is not supported. This will lead to unexpected behavior, data loss and errors INFO[0000] +job init_networkdriver() INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) INFO[0000] -job init_networkdriver() = OK (0) INFO[0000] Loading containers: start. INFO[0000] Loading containers: done. INFO[0000] docker daemon: 1.6.1 97cd073; execdriver: native-0.2; graphdriver: devicemapper INFO[0000] +job acceptconnections() INFO[0000] -job acceptconnections() = OK (0) INFO[0000] Daemon has completed initialization 

I see that there is a warning: " Udev sync is not supported. This will lead to unexpected behavior, data loss and errors ", and after checking the docker source code, I found that the warning log is in deviceset.go :

 func (devices *DeviceSet) initDevmapper(doInit bool) error { ...... // https://github.com/docker/docker/issues/4036 if supported := devicemapper.UdevSetSyncSupport(true); !supported { log.Warnf("Udev sync is not supported. This will lead to unexpected behavior, data loss and errors") } log.Debugf("devicemapper: udev sync support: %v", devicemapper.UdevSyncSupported()) ...... } 

devicemapper.UdevSetSyncSupport as follows:

 // UdevSyncSupported returns whether device-mapper is able to sync with udev // // This is essential otherwise race conditions can arise where both udev and // device-mapper attempt to create and destroy devices. func UdevSyncSupported() bool { return DmUdevGetSyncSupport() != 0 } // UdevSetSyncSupport allows setting whether the udev sync should be enabled. // The return bool indicates the state of whether the sync is enabled. func UdevSetSyncSupport(enable bool) bool { if enable { DmUdevSetSyncSupport(1) } else { DmUdevSetSyncSupport(0) } return UdevSyncSupported() } 

I see that the reason is the inability to synchronize udev . How to enable udev sync?

Update: After checking the dm_udev_set_sync_support disassembly dm_udev_set_sync_support :

 (gdb) disassemble dm_udev_set_sync_support Dump of assembler code for function dm_udev_set_sync_support: => 0x0000000000a3e4e0 <+0>: repz retq End of assembler dump. 

This is an empty function and does nothing, not to mention synchronization support. Does this mean that the static docker embedded binary is not used?

+7
linux docker go rhel rhel7
source share
2 answers

I can not reproduce your problem; I get the following:

 (gdb) disassemble dm_udev_set_sync_support Dump of assembler code for function dm_udev_set_sync_support@plt : 0x0000000000403420 <+0>: jmpq *0xda8c92(%rip) # 0x11ac0b8 < dm_udev_set_sync_support@got.plt > 0x0000000000403426 <+6>: pushq $0x14 0x000000000040342b <+11>: jmpq 0x4032d0 

Do yourself a favor: Ignore the builds docker.io does and get Docker directly from RHEL. It is available on the Extras channel. Although this tends to be several weeks behind releases (e.g. 1.6 instead of 1.7), it is also well tested and guaranteed to work.

0
source share

Revision of my original answer after some useful feedback:

You should use dynamic binary: β€œThe problem, of course, is that with statically linked binary, udev synchronization is not possible, and as such can cause corruption problems. It was difficult for RedHat (which supports the devicemapper driver) to determine because they use a dynamically linked binary (which they provide in their repositories).

Immediately after the release of docker 1.7.0, the provision of rpms and debs with dynamically linked binaries from the main installation of script @ get.docker.com (and apt repos for matching) began. Udev sync is supported with these binaries, and devicemapper should work fine.

Docker, fortunately, has modified its repositories to create dynamic binaries since the creation of the OP.

link: https://github.com/docker/docker/issues/13179

0
source share

All Articles