Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Fabio M. Di Nitto
On 6/19/2012 6:23 AM, Dietmar Maurer wrote:
 Yes, that's a bug. cpglockd will be started from the rgmanager init
 script when RRP mode is enabled.


 Ryan


 Actually no, it's not a bug.

 cpglockd has it's own init script too.
 
 Yes, and that script 'unconditionally' (always) starts cpglockd

Nothing wrong with that. If you ask a daemon to start it will start :)

On top of that, cpglockd is harmless if there is no RRP mode active, or
forcefully disabled.

  
 The Required-Start: tells sysvinint that if cpglockd is enabled, it has to be
 started before rgmanager.
 
 That tells sysvinint to always start that script before rgmanager.
 
 So we end up with cpglockd always running, although it is not required at all.
 
 What do I miss?

It tells sysvinit to start cpglockd before rgmanager IF cpglockd is
enabled via chkconfig, otherwise it is not started. That value is used
only to calculate the symlink S* K** values for rc.d/

Fabio




Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Dietmar Maurer
  Yes, and that script 'unconditionally' (always) starts cpglockd
 
 Nothing wrong with that. If you ask a daemon to start it will start :)

For me this is wrong. I have to maintain a debian package, and I do not want to 
start
unnecessary daemons. So I simply remove that dependency.

Anyways, no problem (I just want to understand what's going on)

Many thanks for your help,

- Dietmar




Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Fabio M. Di Nitto
On 6/19/2012 8:54 AM, Dietmar Maurer wrote:
 Yes, and that script 'unconditionally' (always) starts cpglockd

 Nothing wrong with that. If you ask a daemon to start it will start :)
 
 For me this is wrong. I have to maintain a debian package, and I do not want 
 to start
 unnecessary daemons. So I simply remove that dependency.
 

If Debian handling of daemons has changed, then the change is debian
specific, it doesn´t make it a bug for all distributions.

Last I checked if I run:

apt-get install bind9 - bind9 will start automatically. Or for that
matter also apache2 or

The init scripts we deliver are as generic as possible, it doesn´t
mean that they fit everything everywhere.

And then again, expressing an order is correct. If Required-Start
behavior in Debian is different than in other distro (I can speak for
Fedora/RHEL here), then clearly there needs to be some distro specific
tuning.

Fabio



Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Fabio M. Di Nitto
On 6/19/2012 9:24 AM, Dietmar Maurer wrote:
 And then again, expressing an order is correct. If Required-Start
 behavior in Debian is different than in other distro (I can speak for
 Fedora/RHEL here), then clearly there needs to be some distro specific
 tuning.
 
 You simply start a daemon which is not necessary.


  And I guess you do that on 
 all distros if there is a Required-Start start dependency.

Fresh install on Fedora:

root@fedora16-node2 ~]# chkconfig --list |grep cpg
cpglockd0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@fedora16-node2 ~]# chkconfig rgmanager on
[root@fedora16-node2 ~]# chkconfig --list |grep rg
rgmanager   0:off   1:off   2:on3:on4:on5:on6:off

[root@fedora16-node2 ~]# chkconfig --list |grep cpg
cpglockd0:off   1:off   2:off   3:off   4:off   5:off   6:off

[reboot]

[root@fedora16-node2 ~]# ps ax|grep cpglockd
 3741 pts/1S+ 0:00 grep --color=auto cpglockd
[root@fedora16-node2 ~]#

[root@fedora16-node2 ~]# clustat
[SNIP]
 service:vip1   fedora16-node2 started

As you can see, rgmanager is on, cpglockd off.

At boot rgmanager starts fine, without cpglockd running.

I think the problem here is the interpretation of the LSB specifications
between different distributions. I am not going to argue which one is
right or wrong but the key issue is here:

An init.d shell script may declare using the Required-Start:  header
that it shall not be run until certain boot facilities are provided.
This information is used by the installation tool or the boot-time
boot-script execution facility to assure that init scripts are run in
the correct order.

In the fedora world that means that if cpglockd is enabled (via
chkconfig), the Required-Start: make sure that cpglockd is started
before rgmanager, always.

It is possible that other distributions might interpret that as:
cpglockd must be started even if disabled when rgmanager
Required-Start: cpglockd and rgmanager is enabled.

So based on the platform I use for testing/development, the daemon does
not start unless it is necessary :)

Fabio



Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Fabio M. Di Nitto
On 6/19/2012 10:12 AM, Dietmar Maurer wrote:

 At boot rgmanager starts fine, without cpglockd running.
 I think the problem here is the interpretation of the LSB specifications
 between different distributions. I am not going to argue which one is right 
 or
 wrong but the key issue is here:

 An init.d shell script may declare using the Required-Start:  header that 
 it
 shall not be run until certain boot facilities are provided.
 This information is used by the installation tool or the boot-time 
 boot-script
 execution facility to assure that init scripts are run in the correct order.

 In the fedora world that means that if cpglockd is enabled (via chkconfig), 
 the
 Required-Start: make sure that cpglockd is started before rgmanager, always.

 It is possible that other distributions might interpret that as:
 cpglockd must be started even if disabled when rgmanager
 Required-Start: cpglockd and rgmanager is enabled.

 So based on the platform I use for testing/development, the daemon does
 not start unless it is necessary :)
 
 OK, I was not aware of that.
 
 Many thanks for that detailed reply!

So let´s instead try to figure out the correct fix.

Let´s put one minute aside the possibility that some distributions might
use the second interpretation of LSB header and focus only on the
ordering instead.

Dropping Required-Start: might look like an easy fix in the Debian
world, but that could cripple the startup order as cpglockd could
theoretically land after rgmanager (i don´t think it´s possible, but
let´s not take a chance).

I think the correct fix should be:

move the conditional start start_cpglockd function/check from
rgmanager.init to cpglockd.init.

move the cpglockd is up and running test from rgmanager.init to
cpglockd.init (that´s a bug as-is now).

cpglockd.init should return 0 (success) if it does not need to run and
would allow rgmanager to start given Debian current interpretation of
LSB header.

rgmanager.init can simply fire cpglockd.init without any check, as those
would be done properly by cpglockd.init.

I think this should solve the issue for Debian and keep current behavior
in Fedora.

Fabio



Re: [Cluster-devel] when do I need to start cpglockd

2012-06-19 Thread Dietmar Maurer
 rgmanager.init can simply fire cpglockd.init without any check, as those
 would be done properly by cpglockd.init.
 
 I think this should solve the issue for Debian and keep current behavior in
 Fedora.

Yes, that would work.

- Dietmar