1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2012-04-24 12:25:12 +00:00
parent 7ff84d5269
commit c4da860fd5
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.75 - Version 1.02.75 -
================================ ================================
Synchronize with dead of dmeventd.
Rename (Blk)DevNames/DevNos dmsetup header to (Blk)DevNamesUsed/DevNosUsed. Rename (Blk)DevNames/DevNos dmsetup header to (Blk)DevNamesUsed/DevNosUsed.
Add configure --with-veritysetup for independent veritysetup tool. Add configure --with-veritysetup for independent veritysetup tool.
Properly support passed in dmevent path in dm_event_register_handler(). Properly support passed in dmevent path in dm_event_register_handler().

View File

@ -1893,6 +1893,13 @@ static void restart(void)
exit(EXIT_FAILURE); 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); fini_fifos(&fifos);
} }