LVM2 daemons/dmeventd/dmeventd.c man/dmeventd. ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mornfall at sourceware.org 2011-03-02 12:49:14
Modified files:
daemons/dmeventd: dmeventd.c
man : dmeventd.8.in
test : t-dmeventd-restart.sh
Log message:
As requested in BZ 454618:
- dmeventd -R will continue to start up even if no dmeventd is currently running + a test for this behaviour
- add -R to dmeventd manpage
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/dmeventd.8.in.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-dmeventd-restart.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3
daemons/dmeventd/dmeventd.c +5 -4
@@ -1708,13 +1708,14 @@/* Get the list of registrations from the running daemon. */ if (!init_fifos (&fifos)) { -fprintf (stderr,"Could not initiate communication with existing dmeventd.\n" ); -exit (EXIT_FAILURE ); +fprintf (stderr,"WARNING: Could not initiate communication with existing dmeventd.\n" ); +return ; }if (daemon_talk (&fifos, &msg,DM_EVENT_CMD_HELLO ,NULL ,NULL ,0 ,0 )) { -fprintf (stderr,"Could not communicate with existing dmeventd.\n" ); -exit (EXIT_FAILURE ); +fprintf (stderr,"WARNING: Could not communicate with existing dmeventd.\n" ); +fini_fifos (&fifos); +return ; }if (daemon_talk (&fifos, &msg,DM_EVENT_CMD_GET_STATUS ,"-" ,"-" ,0 ,0 )) {
man/dmeventd.8.in +6 -0
@@ -5,6 +5,7 @@ .B dmeventd [\-d] [\-f] +[\-R] [\-h] [\-V] [\-?]
@@ -33,6 +34,11 @@ .I \-f Don't fork, run in the foreground. .TP +.I \-R +Replace a running dmeventd instance. The running dmeventd must be version +2.02.77 or newer. The new dmeventd instance will obtain a list of devices and +events to monitor from the currently running daemon. +.TP .I \-h, \-? Show help information. .TP
test/t-dmeventd-restart.sh +8 -0
@@ -30,3 +30,11 @@ grep 'already monitored' lvchange.out lvchange --monitor y --verbose $vg/4way 2>&1 | tee lvchange.out grep 'already monitored' lvchange.out + +# now try what happens if no dmeventd is running +kill -9 `cat LOCAL_DMEVENTD` +dmeventd -R -f & +echo "$!" > LOCAL_DMEVENTD +sleep 3 +lvchange --monitor y --verbose $vg/3way 2>&1 | tee lvchange.out +not grep 'already monitored' lvchange.out