ceph/ceph — pull request #1248 by dachary (2014-02-15 23:30:27+00:00)
Title: common: ping existing admin socket before unlink (dumpling)

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)