function rbd_watch_start()
{
local image=$1
+ local asok=$(rbd_watch_asok ${image})
mkfifo $(rbd_watch_fifo ${image})
(cat $(rbd_watch_fifo ${image}) |
- rbd watch ${image} > $(rbd_watch_out_file ${image}) 2>&1)&
+ rbd --admin-socket ${asok} watch ${image} \
+ > $(rbd_watch_out_file ${image}) 2>&1)&
# find pid of the started rbd watch process
local pid
for i in `seq 10`; do
- pid=$(ps auxww | awk "/[r]bd watch ${image}/ {print \$2}")
+ pid=$(ps auxww | awk "/[r]bd --admin.* watch ${image}/ {print \$2}")
test -n "${pid}" && break
sleep 0.1
done
echo ${pid} > $(rbd_watch_pid_file ${image})
# find watcher admin socket
- local asok=$(ceph-conf admin_socket | sed -E "s/[0-9]+/${pid}/")
test -n "${asok}"
for i in `seq 10`; do
test -S "${asok}" && break
sleep 0.1
done
test -S "${asok}"
- ln -s "${asok}" $(rbd_watch_asok ${image})
# configure debug level
ceph --admin-daemon "${asok}" config set debug_rbd 20