ceph/ceph — pull request #1247 by dachary (2014-02-15 23:17:05+00:00)
Title: DNM: common: ping existing admin socket before unlink

When a daemon initializes it tries to create an admin socket and unlinks
any pre-existing file, regardless. If such a file is in use, it causes
the existing daemon to loose its admin socket.

The AdminSocketClient::ping is implemented to probe an existing socket,
using the "0" message. The AdminSocket::bind_and_listen function is
modified to call ping() on when it finds existing file. It unlinks the
file only if the ping fails.

http://tracker.ceph.com/issues/7188 fixes: #7188

Backport: emperor, dumpling
Reviewed-by: Sage Weil
Signed-off-by: Loic Dachary
(cherry picked from commit 45600789f1ca399dddc5870254e5db883fb29b38)