On Fri, Jan 06, 2006 at 12:18:54PM +0900, Horms wrote:
> heartbeat: use invoke-rc.d in postinst ?
> 
> On Thu, Jan 05, 2006 at 07:07:30PM +0000, paddy wrote:
> > Package: heartbeat
> > Version: 1.2.3-9sarge4
> > Severity: important
> > 
> > 
> > See the Subject. Is there a reason why not ?
<snip> 
> Hi Paddy,
> 
> A way for heartbeat to use invoke-rc.d seems like a good idea to me.
> Perhaps the best way would be to make a resource that acts as a
> simple wrapper for invoke-rc.d and can be listed in the haresources
> file.

Hi Horms,

My first reaction was "no, just in postinst!", but I think you have a
point: could be a whole can of worms!

I'm still inclined to imagine that something like 

diff -u old/heartbeat.postinst new/heartbeat.postinst
--- old/heartbeat.postinst      2005-09-28 07:09:28.000000000 +0100
+++ new/heartbeat.postinst      2006-01-06 12:45:19.701212210 +0000
@@ -45,13 +45,21 @@
        update-rc.d heartbeat start 75 2 3 4 5 . stop 05 0 1 6 . >/dev/null || 
true

        ldconfig
-
-       /etc/init.d/heartbeat start || true
+
+        if [ -x /usr/sbin/invoke-rc.d ]; then
+                invoke-rc.d heartbeat start || exit 0
+        else
+                /etc/init.d/heartbeat start || exit 0
+        fi
     ;;

     abort-upgrade|abort-remove|abort-deconfigure)
        # restart heartbeat
-       /etc/init.d/heartbeat start || true
+        if [ -x /usr/sbin/invoke-rc.d ]; then
+                invoke-rc.d heartbeat start || exit 0
+        else
+                /etc/init.d/heartbeat start || exit 0
+        fi
     ;;

     *)

(and I'm imagining similarly in preinst. And you might want to change 
that comment some day :).

would be an improvement on its own, but I agree that it makes sense to 
consider the bigger picture in a case like heartbeat.

I'll have a stab at that now.  Please correct me on the details that
I get wrong, or at least take what I say with a large pinch of salt,
as I have yet to study the code or read the extensive discussion that
took place at the time.

During debian package upgrades (and presumably other package ops)
there is a hazard(s) with the use of 

  /etc/init.d/servicename start

which is resolved or improved by the use of a wrapper as above.

Two obvious possibilities are that the service is not defined to start
in the current runlevel, or that the service was not running prior
to the upgrade and so should not be started.

The question that seems to follow is this:

Suppose that heartbeat is running at the time of an upgrade.
(I'm imagining that) the preinst script will stop it and the
postinst script will start it again, (at least in my ideal
world, and given that I'm guessing the functions of the scripts 
correctly.)

Since heartbeat is a kind of init system within an init system,
does this create a parallel situation inside of heartbeat which 
could require a similar solution?

At first blush the answer would appear to be:

  heartbeat _could_ do stuff it wouldn't otherwise do. (eg: failover),
  but those _should_ be things it is configured to do.
  
  heartbeat doesn't really have runlevels or admin-set-it-that-way
  like sysvinit does?
  
So then there is no problem to solve?

Nevertheless, I find the whole question to be fairly open-ended.

What happens if you have an underlying dependency-based init ?

Might there be a situation in which a request to stop and start
a heartbeat service in order to upgrade a package should be 
denied by the heartbeat system ? ("bring another node online or
overide this safety and then we'll talk about it" ?)

Both package management and init-type systems are open areas of 
development, so its kinda like trying to shoot a moving target 
from a moving platform.  I certainly seems like fun to ask the 
questions, but in the absence of anything promising I'd be happy
to take the easy win.

> I've CCed the linux-ha-dev list as thats a good place for discussions
> like this. Though only members can post (to cut down on spam) so
> you'll need to join up or pass messages to me (or 346117).

I've subscribed to the linux-ha-dev list.

I've refrained from CCing initscripts-ng-devel@lists.alioth.debian.org,
as much because I'm rather dependent on mutt's r,g, and L keys, after
which I'm making it up, and I'm already at the making it up stage! :)

Besides which I recall mixed feelings about whether heartbeat is in scope.
Perhaps there will be something interesting to take there later.

Incidentally, what is "X-Cluestick: seven" ?  and what does it go up to ?

Regards,
Paddy
-- 
Perl 6 will give you the big knob. -- Larry Wall


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to