From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
Date: 26 Sep 2011 07:51:26 -0000 [thread overview]
Message-ID: <20110926075126.9130.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-09-26 07:51:25
Modified files:
. : WHATS_NEW
daemons/clvmd : clvmd-command.c
test : t-clvmd-restart.sh
Log message:
Use execvp for clvmd restart
Since execve passed only NULL as environ, we had lost all environment vars on
restart - thus actually running 'different' clvmd then the one at start.
Preserving environ allows to restart clvmd with the same settings
(i.e. LD_LIBRARY_PATH)
Add test for second restart.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2139&r2=1.2140
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-clvmd-restart.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2
--- LVM2/WHATS_NEW 2011/09/25 19:37:00 1.2139
+++ LVM2/WHATS_NEW 2011/09/26 07:51:23 1.2140
@@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
+ Use execvp for CLVMD restart to preserve environment settings.
Restart CLVMD with same cluster manager.
Fix log_error() usage in raid and unknown segtype initialisation.
Improve testing Makefile.
--- LVM2/daemons/clvmd/clvmd-command.c 2011/09/25 19:37:00 1.60
+++ LVM2/daemons/clvmd/clvmd-command.c 2011/09/26 07:51:24 1.61
@@ -418,7 +418,7 @@
for (argc = 1; argv[argc]; argc++) DEBUGLOG("--- %d: %s\n", argc, argv[argc]);
/* NOTE: This will fail when downgrading! */
- execve(clvmd, (char **)argv, NULL);
+ execvp(clvmd, (char **)argv);
out:
/* We failed */
DEBUGLOG("Restart of clvmd failed.\n");
--- LVM2/test/t-clvmd-restart.sh 2011/09/25 19:37:00 1.1
+++ LVM2/test/t-clvmd-restart.sh 2011/09/26 07:51:24 1.2
@@ -9,13 +9,15 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-export LVM_CLVMD_BINARY="lib/clvmd"
-export LVM_BINARY="lib/lvm"
+# set before test's clvmd is started, so it's passed in environ
+export LVM_CLVMD_BINARY=clvmd
+export LVM_BINARY=lvm
. lib/test
# only clvmd based test, skip otherwise
test -e LOCAL_CLVMD || skip
+read LOCAL_CLVMD < LOCAL_CLVMD
aux prepare_devs 1
@@ -30,15 +32,22 @@
"$LVM_CLVMD_BINARY" -S
sleep .2
-# restarted clvmd has the same PID (no fork, only execve)
+# restarted clvmd has the same PID (no fork, only execvp)
+NEW_LOCAL_CLVMD=$(pgrep clvmd)
+test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
+
+# try restart once more
+
+"$LVM_CLVMD_BINARY" -S
+sleep .2
+# restarted clvmd has the same PID (no fork, only execvp)
NEW_LOCAL_CLVMD=$(pgrep clvmd)
-read LOCAL_CLVMD < LOCAL_CLVMD
test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
# FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
lvchange -an $vg/$lv1
lvchange -ay $vg/$lv1
-lib/clvmd -R
+"$LVM_CLVMD_BINARY" -R
vgremove -ff $vg
next reply other threads:[~2011-09-26 7:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 7:51 zkabelac [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-01 21:16 LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c agk
2011-04-08 14:40 zkabelac
2011-02-18 16:17 zkabelac
2011-02-04 19:18 zkabelac
2011-01-31 19:52 zkabelac
2011-01-17 23:13 mbroz
2011-01-10 14:02 zkabelac
2010-06-17 12:48 mbroz
2010-06-04 12:59 mbroz
2010-01-05 16:07 mbroz
2010-01-05 16:05 mbroz
2009-12-09 18:42 mbroz
2009-04-22 9:39 mbroz
2008-05-09 18:45 agk
2008-05-09 15:13 agk
2008-04-15 14:46 mbroz
2008-04-15 11:36 agk
2006-12-11 14:00 pcaulfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110926075126.9130.qmail@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.