Re: [SSI-devel] onsvc and Debian
Brought to you by:
brucewalker,
rogertsang
From: David B. Z. <dav...@hp...> - 2003-07-30 22:21:31
|
The best way to implement what I suggest in my other E-mail is as follows: Part of /etc/rc.d/rc is going to do the following: onclass -q $CLASS /etc/init.d/$sbusys start This command may or may not start the service on mutiple nodes. So we should have a debian script which creates the lock if the start has an exit code of 0. onclass -q $CLASS debian.lock $subsys /etc/init.d/$subsys start /etc/rc.d/rc.nodeup is going to do the following for joining nodes: onclass -q -L $CLASS /etc/init.d/$subsys start This will execute the command only if the current node is in $CLASS. You don't want to determine that again, so do the same thing onclass -q -L $CLASS debian.lock $subsys /etc/inti.d/$subsys start debian.lock script: #! /bin/sh subsys=$1 shift $* [ $? -eq 0 ] && touch /var/lock/subsys/$subsys <<EOF>>> David B. Zafman wrote: > Aneesh Kumar K.V wrote: > <<<SNIP>>>> > >> I guess you are missing the point here. On which node are we going to >> start the service ? onsvc helps in specifying the set of nodes. >> >> >> > The onclass command will be used by /sbin/service & RC for "start" > only. This is when "all", "initnode" or "node=1,3,5" come into play. > The purpose of onsvc is for "stop" (at least debian supports start and > stop). The reason is that later when we fully support rc.info a > system could boot with a service in "all" class. That means that > onclass all /etc/init.d/service start was issued by "rc" (/etc/rc.d/rc > script on Redhat) during boot. However, if an administator > re-configures that service to say "initnode" it won't take effect > until reboot. However, if he types service SVC stop, on Redhat it > will do an "onsvc SVC /etc/init.d/SVC stop" which issues the stop on > all nodes which had previously we had previously done the start on. > The /cluster/node*/var/lock/subsys files are a database of where the > service had been started on. > > Let's not get side tracked on "status". Yes, "stop" and "status" both > use the onsvc command, but "stop" is still needed on Debian. > > I think that on Debian you should create the > /cluster/node*/var/lock/subsys files on behalf of the RC scripts, so > that onsvc can work. This also keeps track of where things have been > started so that "stop" can work properly. The onsvc command should be > left as-is. That means that all code on Debian that does "start" > which are the equivalent of /sbin/service, /etc/rc.d/rc, and > /etc/rc.d/rc.nodeup must also create the file /var/lock/subsys/SVC > (using the CDSL) on behalf of the RC script. > > If Debian needs these files in another location, then we can build > #ifdef the onsvc code to find the directory elsewhere. > > > David > > > > > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > ssic-linux-devel mailing list > ssi...@li... > https://lists.sourceforge.net/lists/listinfo/ssic-linux-devel > |