FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 06-19-2012, 03:44 AM
"Fabio M. Di Nitto"
 
Default when do I need to start cpglockd

On 06/14/2012 06:06 PM, Ryan McCabe wrote:
> On Thu, Jun 14, 2012 at 03:41:39PM +0000, Dietmar Maurer wrote:
>> I can't see that in the current cman init script. Instead, the rgmanager
>> init script depends on the cpglockd unconditionally:
>>
>> # Required-Start: cman cpglockd
>>
>> So that is a bug?
>
> Hi,
>
> 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.

The Required-Start: tells sysvinint that if cpglockd is enabled, it has
to be started before rgmanager.

rgmanager snippet to start cpglockd is there only for backward
compatibility mode that avoids breaking upgrades from non RRP
environments to RRP. This was done so that users didn't need to enable
cpglockd via chkconfig (being a new daemon and all is not known yet).

A "perfect" install would see the user doing:

chkconfig cpglockd on
chkconfig rgmanager on

only for RRP installations. But then again, docs are fresh, cpglockd is
new.. might as well help the users not to shoot their foot with an RRP
gun

Fabio
 
Old 06-19-2012, 04:23 AM
Dietmar Maurer
 
Default when do I need to start cpglockd

> > 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

> 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?

- Dietmar
 
Old 06-19-2012, 06:20 AM
"Fabio M. Di Nitto"
 
Default when do I need to start cpglockd

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
 
Old 06-19-2012, 06:54 AM
Dietmar Maurer
 
Default when do I need to start cpglockd

> > 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
 
Old 06-19-2012, 07:03 AM
"Fabio M. Di Nitto"
 
Default when do I need to start cpglockd

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
 
Old 06-19-2012, 07:24 AM
Dietmar Maurer
 
Default when do I need to start cpglockd

> 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.

- Dietmar
 
Old 06-19-2012, 08:04 AM
"Fabio M. Di Nitto"
 
Default when do I need to start cpglockd

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
cpglockd 0ff 1ff 2ff 3ff 4ff 5ff 6ff

[root@fedora16-node2 ~]# chkconfig rgmanager on
[root@fedora16-node2 ~]# chkconfig --list |grep rg
rgmanager 0ff 1ff 2n 3n 4n 5n 6ff

[root@fedora16-node2 ~]# chkconfig --list |grep cpg
cpglockd 0ff 1ff 2ff 3ff 4ff 5ff 6ff

[reboot]

[root@fedora16-node2 ~]# ps ax|grep cpglockd
3741 pts/1 S+ 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
 
Old 06-19-2012, 08:12 AM
Dietmar Maurer
 
Default when do I need to start cpglockd

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

I see.

> 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!

- Dietmar
 
Old 06-19-2012, 08:33 AM
"Fabio M. Di Nitto"
 
Default when do I need to start cpglockd

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
 
Old 06-19-2012, 08:36 AM
Dietmar Maurer
 
Default when do I need to start cpglockd

> 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
 

Thread Tools




All times are GMT. The time now is 10:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright Đ2007 - 2008, www.linux-archive.org