diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-04-24 12:25:12 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-04-24 12:25:12 +0000 |
commit | d6f894edf88c83ea8605d005ebb5d14e0c75fe36 (patch) | |
tree | 5a3e6de53d32e3ea0ae33c0ca67b2adb1f0577ef /daemons/dmeventd/dmeventd.c | |
parent | dd11efb673da04ef356712a09e7ce11e4e3fd085 (diff) | |
download | lvm2-d6f894edf88c83ea8605d005ebb5d14e0c75fe36.tar.gz lvm2-d6f894edf88c83ea8605d005ebb5d14e0c75fe36.tar.xz lvm2-d6f894edf88c83ea8605d005ebb5d14e0c75fe36.zip |
Synchronize with self-destruction of dmeventd
In some occasional case dmevent restart was experiencing problems
with obtaining pid lockfile. So this patch tries to send several more kill
message until daemon kills itself so there is would reponse.
With this small loop the restart seems to work reliable,
although the loopsize and usleep are just randomly picked for now.
Diffstat (limited to 'daemons/dmeventd/dmeventd.c')
-rw-r--r-- | daemons/dmeventd/dmeventd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index ab9d23d3..801c984f 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -1893,6 +1893,13 @@ static void restart(void) exit(EXIT_FAILURE); } + /* Let's wait a bit till deamon dies - spaming him with messages meanwhile */ + for (i = 0; i < 10; ++i) { + if (daemon_talk(&fifos, &msg, DM_EVENT_CMD_DIE, "-", "-", 0, 0)) + break; /* yep, it's dead probably */ + usleep(10); + } + fini_fifos(&fifos); } |