All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix some issues in clvmd initscript
@ 2010-05-26 13:01 Milan Broz
  2010-06-03  7:05 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 11+ messages in thread
From: Milan Broz @ 2010-05-26 13:01 UTC (permalink / raw)
  To: lvm-devel

- if daemon is already running, do nothing (and not reactivate VGs)

- always explicitly return exit code in reload()

- fix restart() so it really tries full start & stop and returns exit code
  if clvmd -S fails and also touch lockfile afterwards

--- clvmd.old	2010-05-26 14:21:15.000000000 +0200
+++ clvmd	2010-05-26 14:55:17.671245376 +0200
@@ -63,11 +63,12 @@ rh_status_q() {
 
 start()
 {
-	if ! rh_status_q; then
-		echo -n "Starting $DAEMON: "
-		daemon $DAEMON $CLVMDOPTS || return $?
-		echo
-	fi
+
+	rh_status_q && return 0
+
+	echo -n "Starting $DAEMON: "
+	daemon $DAEMON $CLVMDOPTS || return $?
+	echo
 
 	# Refresh local cache.
 	#
@@ -141,7 +142,8 @@ stop()
 
 reload() {
 	rh_status_q || exit 7
-	action "Reloading $DAEMON configuration: " $DAEMON -R || return $?
+	action "Reloading $DAEMON configuration: " $DAEMON -R
+	return $?
 }
 
 restart() {
@@ -152,13 +154,15 @@ restart() {
 
 	# Try to get clvmd to restart itself. This will preserve 
 	# exclusive LV locks
-	action "Restarting $DAEMON: " $DAEMON -S || return $?
+	action "Restarting $DAEMON: " $DAEMON -S
 
 	# If that fails then do a normal stop & restart
 	if  [ $? != 0 ]; then
 	    stop && start
+	    return $?
 	else
 	    touch $LOCK_FILE
+	    return 0
 	fi
 }
 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-05-26 13:01 [PATCH] fix some issues in clvmd initscript Milan Broz
@ 2010-06-03  7:05 ` Fabio M. Di Nitto
  2010-06-03  9:51   ` Milan Broz
  0 siblings, 1 reply; 11+ messages in thread
From: Fabio M. Di Nitto @ 2010-06-03  7:05 UTC (permalink / raw)
  To: lvm-devel

On 5/26/2010 3:01 PM, Milan Broz wrote:
> - if daemon is already running, do nothing (and not reactivate VGs)
> 
> - always explicitly return exit code in reload()
> 
> - fix restart() so it really tries full start & stop and returns exit code
>   if clvmd -S fails and also touch lockfile afterwards
> 
> --- clvmd.old	2010-05-26 14:21:15.000000000 +0200
> +++ clvmd	2010-05-26 14:55:17.671245376 +0200
> @@ -63,11 +63,12 @@ rh_status_q() {
>  
>  start()
>  {
> -	if ! rh_status_q; then
> -		echo -n "Starting $DAEMON: "
> -		daemon $DAEMON $CLVMDOPTS || return $?
> -		echo
> -	fi
> +
> +	rh_status_q && return 0
> +
> +	echo -n "Starting $DAEMON: "
> +	daemon $DAEMON $CLVMDOPTS || return $?
> +	echo

careful with this change as it modifies the behavior compared to the old
init script.

In the transition from old to new, we didn?t really want to modify what
the script does.

Cheers
Fabio



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03  7:05 ` Fabio M. Di Nitto
@ 2010-06-03  9:51   ` Milan Broz
  2010-06-03 11:43     ` Fabio M. Di Nitto
  0 siblings, 1 reply; 11+ messages in thread
From: Milan Broz @ 2010-06-03  9:51 UTC (permalink / raw)
  To: lvm-devel

On 06/03/2010 09:05 AM, Fabio M. Di Nitto wrote:
> On 5/26/2010 3:01 PM, Milan Broz wrote:
>> - if daemon is already running, do nothing (and not reactivate VGs)
>>
>> - always explicitly return exit code in reload()
>>
>> - fix restart() so it really tries full start & stop and returns exit code
>>   if clvmd -S fails and also touch lockfile afterwards
>>
>> --- clvmd.old	2010-05-26 14:21:15.000000000 +0200
>> +++ clvmd	2010-05-26 14:55:17.671245376 +0200
>> @@ -63,11 +63,12 @@ rh_status_q() {
>>  
>>  start()
>>  {
>> -	if ! rh_status_q; then
>> -		echo -n "Starting $DAEMON: "
>> -		daemon $DAEMON $CLVMDOPTS || return $?
>> -		echo
>> -	fi
>> +
>> +	rh_status_q && return 0
>> +
>> +	echo -n "Starting $DAEMON: "
>> +	daemon $DAEMON $CLVMDOPTS || return $?
>> +	echo
> 
> careful with this change as it modifies the behavior compared to the old
> init script.

So you want reactivate LVs even if clvmd is already running?
This is wrong IMHO.

Milan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03  9:51   ` Milan Broz
@ 2010-06-03 11:43     ` Fabio M. Di Nitto
  2010-06-03 18:31       ` brem belguebli
  0 siblings, 1 reply; 11+ messages in thread
From: Fabio M. Di Nitto @ 2010-06-03 11:43 UTC (permalink / raw)
  To: lvm-devel

On 6/3/2010 11:51 AM, Milan Broz wrote:
> On 06/03/2010 09:05 AM, Fabio M. Di Nitto wrote:
>> On 5/26/2010 3:01 PM, Milan Broz wrote:
>>> - if daemon is already running, do nothing (and not reactivate VGs)
>>>
>>> - always explicitly return exit code in reload()
>>>
>>> - fix restart() so it really tries full start & stop and returns exit code
>>>   if clvmd -S fails and also touch lockfile afterwards
>>>
>>> --- clvmd.old	2010-05-26 14:21:15.000000000 +0200
>>> +++ clvmd	2010-05-26 14:55:17.671245376 +0200
>>> @@ -63,11 +63,12 @@ rh_status_q() {
>>>  
>>>  start()
>>>  {
>>> -	if ! rh_status_q; then
>>> -		echo -n "Starting $DAEMON: "
>>> -		daemon $DAEMON $CLVMDOPTS || return $?
>>> -		echo
>>> -	fi
>>> +
>>> +	rh_status_q && return 0
>>> +
>>> +	echo -n "Starting $DAEMON: "
>>> +	daemon $DAEMON $CLVMDOPTS || return $?
>>> +	echo
>>
>> careful with this change as it modifies the behavior compared to the old
>> init script.
> 
> So you want reactivate LVs even if clvmd is already running?

Let me get this right :) I don?t care either way. Whatever the team
wants is fine. I am only noticing that this a behavior change vs the old
init script.

Fabio



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 11:43     ` Fabio M. Di Nitto
@ 2010-06-03 18:31       ` brem belguebli
  2010-06-03 19:51         ` Alasdair G Kergon
  0 siblings, 1 reply; 11+ messages in thread
From: brem belguebli @ 2010-06-03 18:31 UTC (permalink / raw)
  To: lvm-devel

Hi,

just a suggestion, but, in case one wants to use clvm in a
active/passive maner, there is a problem with the way clvmd is
started, as it tries to activate all the clustered VG's whether or not
they're already active  on another node.

In case of active/passive setup, by the means of exclusive activation,
this activation returns an error  (as of LMV2.0.56, cf
https://bugzilla.redhat.com/show_bug.cgi?id=517900, errata
http://rhn.redhat.com/errata/RHBA-2010-0299.html)

Another scenario being, when using exclusive activation, the cluster
resources can be managed by a "custom" cluster resource script (cf
https://www.redhat.com/archives/linux-cluster/2009-June/msg00002.html),
the resource script fails to start as clvmd init script has already
activated the VG's.

My suggestion would be to be able to forbid (via an exclusion list)
clvmd init script to activate automatically what's in this blacklist.

Regards

Brem


2010/6/3 Fabio M. Di Nitto <fdinitto@redhat.com>:
> On 6/3/2010 11:51 AM, Milan Broz wrote:
>> On 06/03/2010 09:05 AM, Fabio M. Di Nitto wrote:
>>> On 5/26/2010 3:01 PM, Milan Broz wrote:
>>>> - if daemon is already running, do nothing (and not reactivate VGs)
>>>>
>>>> - always explicitly return exit code in reload()
>>>>
>>>> - fix restart() so it really tries full start & stop and returns exit code
>>>> ? if clvmd -S fails and also touch lockfile afterwards
>>>>
>>>> --- clvmd.old ? ? ? 2010-05-26 14:21:15.000000000 +0200
>>>> +++ clvmd ? 2010-05-26 14:55:17.671245376 +0200
>>>> @@ -63,11 +63,12 @@ rh_status_q() {
>>>>
>>>> ?start()
>>>> ?{
>>>> - ? if ! rh_status_q; then
>>>> - ? ? ? ? ? echo -n "Starting $DAEMON: "
>>>> - ? ? ? ? ? daemon $DAEMON $CLVMDOPTS || return $?
>>>> - ? ? ? ? ? echo
>>>> - ? fi
>>>> +
>>>> + ? rh_status_q && return 0
>>>> +
>>>> + ? echo -n "Starting $DAEMON: "
>>>> + ? daemon $DAEMON $CLVMDOPTS || return $?
>>>> + ? echo
>>>
>>> careful with this change as it modifies the behavior compared to the old
>>> init script.
>>
>> So you want reactivate LVs even if clvmd is already running?
>
> Let me get this right :) I don?t care either way. Whatever the team
> wants is fine. I am only noticing that this a behavior change vs the old
> init script.
>
> Fabio
>
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 18:31       ` brem belguebli
@ 2010-06-03 19:51         ` Alasdair G Kergon
  2010-06-03 20:15           ` Brem Belguebli
  0 siblings, 1 reply; 11+ messages in thread
From: Alasdair G Kergon @ 2010-06-03 19:51 UTC (permalink / raw)
  To: lvm-devel

On Thu, Jun 03, 2010 at 08:31:22PM +0200, brem belguebli wrote:
> started, as it tries to activate all the clustered VG's whether or not
> they're already active  on another node.
 
/etc/sysconfig/clvmd perhaps?


Something like:

# Specifies whether or not to activate clustered LVs after starting up clvmd.
# Note that this file only controls which 'lvchange' commands get run
# and it cannot override lvm.conf.
ACTIVATE=yes

# Space-separated lists of LVs to activate when starting CLVMD.
# Specifying a VG will activate all the LVs within it.

# Clustered LVs activated with "lvchange -aey" on this machine.
# E.g. EXCLUSIVE_LVS="vg1/lvol0 vg1/lvol1 vg2"
EXCLUSIVE_LVS=

# Clustered LVs activated with "lvchange -aly" on this machine.
LOCAL_LVS=

# Clustered LVs activated with "lvchange -ay".
# If all 3 variables (LOCAL_LVS, EXCLUSIVE_LVS & SHARED_LVS) are unset
# or empty and ACTIVATE is "yes" then all clustered LVs visible on the system
# are activated as shared.
SHARED_LVS=


Alasdair



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 19:51         ` Alasdair G Kergon
@ 2010-06-03 20:15           ` Brem Belguebli
  2010-06-03 20:20             ` Alasdair G Kergon
  0 siblings, 1 reply; 11+ messages in thread
From: Brem Belguebli @ 2010-06-03 20:15 UTC (permalink / raw)
  To: lvm-devel


On Thu, 2010-06-03 at 20:51 +0100, Alasdair G Kergon wrote:
> On Thu, Jun 03, 2010 at 08:31:22PM +0200, brem belguebli wrote:
> > started, as it tries to activate all the clustered VG's whether or not
> > they're already active  on another node.
>  
> /etc/sysconfig/clvmd perhaps?
> 
Exactly what I was hopping....you're so reactive gentlemen... ;-)
> 
> Something like:
> 
> # Specifies whether or not to activate clustered LVs after starting up clvmd.
> # Note that this file only controls which 'lvchange' commands get run
> # and it cannot override lvm.conf.
> ACTIVATE=yes
> 
> # Space-separated lists of LVs to activate when starting CLVMD.
> # Specifying a VG will activate all the LVs within it.
> 
> # Clustered LVs activated with "lvchange -aey" on this machine.
> # E.g. EXCLUSIVE_LVS="vg1/lvol0 vg1/lvol1 vg2"
> EXCLUSIVE_LVS=
> 
> # Clustered LVs activated with "lvchange -aly" on this machine.
> LOCAL_LVS=
> 
> # Clustered LVs activated with "lvchange -ay".
> # If all 3 variables (LOCAL_LVS, EXCLUSIVE_LVS & SHARED_LVS) are unset
> # or empty and ACTIVATE is "yes" then all clustered LVs visible on the system
> # are activated as shared.
> SHARED_LVS=
> 
> 


Next time I'll read more carefully the man pages / init scripts /
sysconfig configurations

Sorry .

Brem
> Alasdair
> 
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 20:15           ` Brem Belguebli
@ 2010-06-03 20:20             ` Alasdair G Kergon
  2010-06-03 20:25               ` Brem Belguebli
  0 siblings, 1 reply; 11+ messages in thread
From: Alasdair G Kergon @ 2010-06-03 20:20 UTC (permalink / raw)
  To: lvm-devel

On Thu, Jun 03, 2010 at 10:15:12PM +0200, Brem Belguebli wrote:
> Next time I'll read more carefully the man pages / init scripts /
> sysconfig configurations
 
That's only a proposal, to see if it would cover the cases people need.
It's not been implemented.

Alasdair



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 20:20             ` Alasdair G Kergon
@ 2010-06-03 20:25               ` Brem Belguebli
  2010-06-03 20:34                 ` Alasdair G Kergon
  0 siblings, 1 reply; 11+ messages in thread
From: Brem Belguebli @ 2010-06-03 20:25 UTC (permalink / raw)
  To: lvm-devel

It looked so real I thought you were pushing me back to my seat.

Perfect, exactly what I was expecting.

Default would be to activate not to bother the gfs users....

Brem

On Thu, 2010-06-03 at 21:20 +0100, Alasdair G Kergon wrote:
> On Thu, Jun 03, 2010 at 10:15:12PM +0200, Brem Belguebli wrote:
> > Next time I'll read more carefully the man pages / init scripts /
> > sysconfig configurations
>  
> That's only a proposal, to see if it would cover the cases people need.
> It's not been implemented.
> 
> Alasdair




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 20:25               ` Brem Belguebli
@ 2010-06-03 20:34                 ` Alasdair G Kergon
  2010-06-03 20:57                   ` Brem Belguebli
  0 siblings, 1 reply; 11+ messages in thread
From: Alasdair G Kergon @ 2010-06-03 20:34 UTC (permalink / raw)
  To: lvm-devel

On Thu, Jun 03, 2010 at 10:25:36PM +0200, Brem Belguebli wrote:
> It looked so real I thought you were pushing me back to my seat.
 
Nah, I just typed that directly into the email.

We'll capture it into bugzilla, and I'm hoping we won't hit too many
gotchas and it will be quick and easy to implement.

Alasdair



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] fix some issues in clvmd initscript
  2010-06-03 20:34                 ` Alasdair G Kergon
@ 2010-06-03 20:57                   ` Brem Belguebli
  0 siblings, 0 replies; 11+ messages in thread
From: Brem Belguebli @ 2010-06-03 20:57 UTC (permalink / raw)
  To: lvm-devel

On Thu, 2010-06-03 at 21:34 +0100, Alasdair G Kergon wrote:
> On Thu, Jun 03, 2010 at 10:25:36PM +0200, Brem Belguebli wrote:
> > It looked so real I thought you were pushing me back to my seat.
>  
> Nah, I just typed that directly into the email.
> 
> We'll capture it into bugzilla, and I'm hoping we won't hit too many
> gotchas and it will be quick and easy to implement.
> 
Great, thanks

By the way, not trying to being rude, but it would be great if you could
"re" consider the resource script provided by Rafael Mico Miranda
https://www.redhat.com/archives/linux-cluster/2009-June/msg00002.html,
to see if it can be integrated to Cluster Suite, having Redhat's seal on
it would be a must.

   
> Alasdair

Brem



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-06-03 20:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-26 13:01 [PATCH] fix some issues in clvmd initscript Milan Broz
2010-06-03  7:05 ` Fabio M. Di Nitto
2010-06-03  9:51   ` Milan Broz
2010-06-03 11:43     ` Fabio M. Di Nitto
2010-06-03 18:31       ` brem belguebli
2010-06-03 19:51         ` Alasdair G Kergon
2010-06-03 20:15           ` Brem Belguebli
2010-06-03 20:20             ` Alasdair G Kergon
2010-06-03 20:25               ` Brem Belguebli
2010-06-03 20:34                 ` Alasdair G Kergon
2010-06-03 20:57                   ` Brem Belguebli

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.