Discussion:
[CI] CVS: cluster-tools/cmd noded.c,1.2,1.3 Makefile,1.11,1.12
Aneesh Kumar K.V
2002-10-30 10:47:02 UTC
Permalink
Hi,

But rc.nodedown is installed only for SSI and is also installed at a
location dependent on distro( /etc/rc.d for redhat and /etc/init.d for
debian. ) How do you want to handle this ?

-aneesh
Update of /cvsroot/ci-linux/cluster-tools/cmd
In directory usw-pr-cvs1:/tmp/cvs-serv10017/cmd
Makefile
noded.c
Added noded back into build which I mistakenly deleted. (Needed for CI)
Index: Makefile
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/cmd/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Makefile 28 Aug 2002 04:02:53 -0000 1.11
--- Makefile 30 Oct 2002 01:17:25 -0000 1.12
***************
*** 34,37 ****
--- 34,38 ----
clusternode_setstate \
clusternode_num \
+ noded \
onnode \
onall \
***************
*** 63,66 ****
--- 64,70 ----
+ noded: noded.o
+
onnode: onnode.o
***************
*** 97,100 ****
--- 101,105 ----
$(INSTALL) clusternode_setstate $(UML_ROOT)$(USRSBIN)/clusternode_setstate
$(INSTALL) clusternode_num $(UML_ROOT)$(USRSBIN)/clusternode_num
+ $(INSTALL) -m 755 -o root -g root noded $(UML_ROOT)$(USRSBIN)/noded
$(INSTALL) cluster_start $(UML_ROOT)$(USRSBIN)/cluster_start
$(INSTALL) onnode $(UML_ROOT)$(USRSBIN)/onnode
***************
*** 115,118 ****
--- 120,124 ----
rm -f $(UML_ROOT)$(USRSBIN)/clusternode_setstate
rm -f $(UML_ROOT)$(USRSBIN)/clusternode_num
+ rm -f $(UML_ROOT)$(USRSBIN)/noded
rm -f $(UML_ROOT)$(USRSBIN)/cluster_start
rm -f $(UML_ROOT)$(SBIN)/onnode
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Ci-linux-checkins mailing list
https://lists.sourceforge.net/lists/listinfo/ci-linux-checkins
John Byrne
2002-10-30 16:20:04 UTC
Permalink
Post by Aneesh Kumar K.V
Hi,
But rc.nodedown is installed only for SSI and is also installed at a
location dependent on distro( /etc/rc.d for redhat and /etc/init.d for
debian. ) How do you want to handle this ?
-aneesh
Someone complained about me deleting it and a bug was opened under CI
about it. I'm finally fixing it. The exact complaint was that the
cluster_start command calls it and it wasn't there. I'm not sure where
or how the cluster_start script is supposed to be used.

John
Post by Aneesh Kumar K.V
Update of /cvsroot/ci-linux/cluster-tools/cmd
In directory usw-pr-cvs1:/tmp/cvs-serv10017/cmd
Makefile
noded.c
Added noded back into build which I mistakenly deleted. (Needed for CI)
Index: Makefile
===================================================================
RCS file: /cvsroot/ci-linux/cluster-tools/cmd/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Makefile 28 Aug 2002 04:02:53 -0000 1.11
--- Makefile 30 Oct 2002 01:17:25 -0000 1.12
***************
*** 34,37 ****
--- 34,38 ----
clusternode_setstate \
clusternode_num \
+ noded \
onnode \
onall \
***************
*** 63,66 ****
--- 64,70 ----
+ noded: noded.o
+
onnode: onnode.o
***************
*** 97,100 ****
--- 101,105 ----
$(INSTALL) clusternode_setstate $(UML_ROOT)$(USRSBIN)/clusternode_setstate
$(INSTALL) clusternode_num $(UML_ROOT)$(USRSBIN)/clusternode_num
+ $(INSTALL) -m 755 -o root -g root noded $(UML_ROOT)$(USRSBIN)/noded
$(INSTALL) cluster_start $(UML_ROOT)$(USRSBIN)/cluster_start
$(INSTALL) onnode $(UML_ROOT)$(USRSBIN)/onnode
***************
*** 115,118 ****
--- 120,124 ----
rm -f $(UML_ROOT)$(USRSBIN)/clusternode_setstate
rm -f $(UML_ROOT)$(USRSBIN)/clusternode_num
+ rm -f $(UML_ROOT)$(USRSBIN)/noded
rm -f $(UML_ROOT)$(USRSBIN)/cluster_start
rm -f $(UML_ROOT)$(SBIN)/onnode
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Ci-linux-checkins mailing list
https://lists.sourceforge.net/lists/listinfo/ci-linux-checkins
David B. Zafman
2002-10-30 16:32:07 UTC
Permalink
Post by John Byrne
Someone complained about me deleting it and a bug was opened under CI
about it. I'm finally fixing it. The exact complaint was that the
cluster_start command calls it and it wasn't there. I'm not sure where
or how the cluster_start script is supposed to be used.
John
The cluster_start script can be run by hand to join a CI cluster, or add it to the RC process depending on the distribution.

In RedHat you would add it to "/etc/rc.d/rc.local" for example.

--
David B. Zafman | Hewlett-Packard Company
mailto:***@hp.com | http://www.hp.com
"Thus spake the master programmer: When you have learned to snatch
the error code from the trap frame, it will be time for you to leave."
Aneesh Kumar K.V
2002-10-31 02:24:04 UTC
Permalink
Post by John Byrne
Post by Aneesh Kumar K.V
Hi,
But rc.nodedown is installed only for SSI and is also installed at a
location dependent on distro( /etc/rc.d for redhat and /etc/init.d for
debian. ) How do you want to handle this ?
-aneesh
Someone complained about me deleting it and a bug was opened under CI
about it. I'm finally fixing it. The exact complaint was that the
cluster_start command calls it and it wasn't there. I'm not sure where
or how the cluster_start script is supposed to be used.
John
In the case of CI we use cluster_start to start the CI subsystem. CI
doesn't make use of ramdisk. I guess noded purpose was to execute some
command in the UP nodes when some nodes goes down and in this case set
the state of the node that went down as DOWN
(/usr/sbin/clusternode_setstate $1 DOWN ). But the location of the
rc.nodedown script is distro dependent. One solution is to set the
state of the node went down by using library( libcluster.so,
clusternode_setinfo ) rather than rc.nodedown.



--- noded.c.old Wed Oct 30 06:47:25 2002
+++ noded.c Mon Oct 31 05:52:36 2050
@@ -64,8 +64,6 @@
/* prototypes */
void daemonize(void);
void do_nodedown(clusternode_t);
-void execute_files(clusternode_t, char *);
-void execute_commands(clusternode_t, char *);

char *states[] = { "UNDEFINED",
"NEVERUP",
@@ -231,69 +229,10 @@
void
do_nodedown(clusternode_t node)
{
- pid_t childpid;
-
- /*
- * execute commands on local node
- */
- if ((childpid = fork()) != 0) {
- if (childpid == -1) {
- fprintf(stderr, "ERROR: fork failed...\n"
- "\tReason: %s\n", strerror(errno));
- }
- } else { /* child */
- execute_files(node, NODEDOWN_SCRIPT);
- /*
- * child will exit here
- */
- exit(0);
- }
-
- /*
- * parent will return here
- */
+ clusternode_info_t node_info;
+ node_info.node_num = node;
+ node_info.node_state = 8; /* 8 = DOWN clusternode_setstate.c */
+ clusternode_setinfo(node, CLUSTERNODE_SETSTATE,
+ sizeof(node_info), &node_info);
return;
-}
-
-void
-execute_files(
- clusternode_t node,
- char *filename)
-{
- struct sigaction sigact;
-
- /*
- * Save zombie children
- */
- sigact.sa_handler = SIG_DFL;
- sigact.sa_flags &= ~SA_NOCLDWAIT;
- sigaction(SIGCHLD, &sigact, (struct sigaction *)0);
-
- /*
- * Execute generic script
- */
- execute_commands(node, filename);
-}
-
-void
-execute_commands(
- clusternode_t node,
- char *filename)
-{
- char *argv[3];
- char nodenum[20];
-
- sprintf(nodenum, "%ld", node);
- argv[0] = filename;
- argv[1] = nodenum;
- argv[2] = NULL;
-
- execv(filename, argv);
-
- fprintf(stderr,
- "WARNING: unable to execute script...\n"
- "\tScript: \"%s\"\n"
- "\tReason: %s\n",
- filename, strerror(errno));
- exit(1);
}

-aneesh
David B. Zafman
2002-10-31 16:06:04 UTC
Permalink
The problem with your proposed solution is that the rc.nodedown script
provides an "RC like" environment for a administrator to put in code that
handles the failure of a node for
a cluster component. When all the user-defined actions are complete, if any,
the script ends by setting the state to DOWN. Obviously, there is no place
to put user defined actions
if noded directly changes the state to DOWN and doesn't execute a shell
script.
Post by Aneesh Kumar K.V
In the case of CI we use cluster_start to start the CI subsystem. CI
doesn't make use of ramdisk. I guess noded purpose was to execute some
command in the UP nodes when some nodes goes down and in this case set
the state of the node that went down as DOWN
(/usr/sbin/clusternode_setstate $1 DOWN ). But the location of the
rc.nodedown script is distro dependent. One solution is to set the
state of the node went down by using library( libcluster.so,
clusternode_setinfo ) rather than rc.nodedown.
--- noded.c.old Wed Oct 30 06:47:25 2002
+++ noded.c Mon Oct 31 05:52:36 2050
@@ -64,8 +64,6 @@
/* prototypes */
void daemonize(void);
void do_nodedown(clusternode_t);
-void execute_files(clusternode_t, char *);
-void execute_commands(clusternode_t, char *);
char *states[] = { "UNDEFINED",
"NEVERUP",
@@ -231,69 +229,10 @@
void
do_nodedown(clusternode_t node)
{
- pid_t childpid;
-
- /*
- * execute commands on local node
- */
- if ((childpid = fork()) != 0) {
- if (childpid == -1) {
- fprintf(stderr, "ERROR: fork failed...\n"
- "\tReason: %s\n", strerror(errno));
- }
- } else { /* child */
- execute_files(node, NODEDOWN_SCRIPT);
- /*
- * child will exit here
- */
- exit(0);
- }
-
- /*
- * parent will return here
- */
+ clusternode_info_t node_info;
+ node_info.node_num = node;
+ node_info.node_state = 8; /* 8 = DOWN clusternode_setstate.c */
+ clusternode_setinfo(node, CLUSTERNODE_SETSTATE,
+ sizeof(node_info), &node_info);
return;
-}
-
-void
-execute_files(
- clusternode_t node,
- char *filename)
-{
- struct sigaction sigact;
-
- /*
- * Save zombie children
- */
- sigact.sa_handler = SIG_DFL;
- sigact.sa_flags &= ~SA_NOCLDWAIT;
- sigaction(SIGCHLD, &sigact, (struct sigaction *)0);
-
- /*
- * Execute generic script
- */
- execute_commands(node, filename);
-}
-
-void
-execute_commands(
- clusternode_t node,
- char *filename)
-{
- char *argv[3];
- char nodenum[20];
-
- sprintf(nodenum, "%ld", node);
- argv[0] = filename;
- argv[1] = nodenum;
- argv[2] = NULL;
-
- execv(filename, argv);
-
- fprintf(stderr,
- "WARNING: unable to execute script...\n"
- "\tScript: \"%s\"\n"
- "\tReason: %s\n",
- filename, strerror(errno));
- exit(1);
}
-aneesh
-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
ci-linux-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ci-linux-devel
--
David B. Zafman | Hewlett-Packard Company
mailto:***@hp.com | http://www.hp.com
"Thus spake the master programmer: When you have learned to snatch
the error code from the trap frame, it will be time for you to leave."
Loading...