[SCM] CTDB repository - branch master updated - dfaf2c1581e547df831b3171ad47acd27b4ca2af

Ronnie Sahlberg sahlberg at samba.org
Thu Jul 10 07:01:56 GMT 2008


The branch, master has been updated
       via  dfaf2c1581e547df831b3171ad47acd27b4ca2af (commit)
       via  c47acc0eb2e1275a6c6fc05829bd1131d999f8fd (commit)
       via  2cc9aba3d7e608eccc29c897f710b69f30653bbf (commit)
      from  919af5aadb797cfdd10473b6a1269f4ae2a9dbda (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit dfaf2c1581e547df831b3171ad47acd27b4ca2af
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 10 14:19:52 2008 +1000

    When in verbose mode with -p, each line is prefixed with the node
    address/name.  To implement this stderr has redirected to stdout -
    this doesn't need to be done but is the simplest implementation.
    Remove -t option since it doesn't seem to accomplish much but causes
    spurious messages to be displayed by ssh.  Add explicit -h and --help
    options.  Make style of usage message consistent with documentation.
    Document new features in doc/onnode.1.xml.

commit c47acc0eb2e1275a6c6fc05829bd1131d999f8fd
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 9 14:23:02 2008 +1000

    Update Makefile.in for new version of onnode.

commit 2cc9aba3d7e608eccc29c897f710b69f30653bbf
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 9 14:18:15 2008 +1000

    Complete rewrite of tools/onnode.  Remove old tools/onnode.ssh,
    tools/onnode.rsh.

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in       |    4 +-
 doc/onnode.1      |  347 ++++++++++++++++++++++++++++++++++++++++++++++++----
 doc/onnode.1.html |   69 ++++++++---
 doc/onnode.1.xml  |  126 ++++++++++++++++----
 tools/onnode      |  191 +++++++++++++++++++++++++++++
 tools/onnode.rsh  |   44 -------
 tools/onnode.ssh  |   44 -------
 7 files changed, 667 insertions(+), 158 deletions(-)
 mode change 100644 => 100755 Makefile.in
 create mode 100755 tools/onnode
 delete mode 100644 tools/onnode.rsh
 delete mode 100755 tools/onnode.ssh


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
old mode 100644
new mode 100755
index a8fa197..9b5ebe0
--- a/Makefile.in
+++ b/Makefile.in
@@ -193,13 +193,11 @@ install: all
 	${INSTALLCMD} -m 755 config/events.d/90.ipmux $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 config/events.d/91.lvs $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 tools/ctdb_diagnostics $(DESTDIR)$(bindir)
-	${INSTALLCMD} -m 755 tools/onnode.ssh $(DESTDIR)$(bindir)
-	${INSTALLCMD} -m 755 tools/onnode.rsh $(DESTDIR)$(bindir)
+	${INSTALLCMD} -m 755 tools/onnode $(DESTDIR)$(bindir)
 	if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man1; fi
 	if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -m 644 doc/ctdb.1 $(DESTDIR)$(mandir)/man1; fi
 	if [ -f doc/ctdbd.1 ];then ${INSTALLCMD} -m 644 doc/ctdbd.1 $(DESTDIR)$(mandir)/man1; fi
 	if [ -f doc/onnode.1 ];then ${INSTALLCMD} -m 644 doc/onnode.1 $(DESTDIR)$(mandir)/man1; fi
-	cd $(DESTDIR)$(bindir) && ln -sf onnode.ssh onnode
 
 test: all
 	tests/run_tests.sh
diff --git a/doc/onnode.1 b/doc/onnode.1
index 926df4d..9923867 100644
--- a/doc/onnode.1
+++ b/doc/onnode.1
@@ -1,79 +1,372 @@
 .\"     Title: onnode
-.\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 07/10/2007
-.\"    Manual: 
-.\"    Source: 
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
+.\"      Date: 07/10/2008
+.\"    Manual: [FIXME: manual]
+.\"    Source: [FIXME: source]
+.\"  Language: English
 .\"
-.TH "ONNODE" "1" "07/10/2007" "" ""
+.TH "ONNODE" "1" "07/10/2008" "[FIXME: source]" "[FIXME: manual]"
+.\" -----------------------------------------------------------------
+.\" * (re)Define some macros
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" toupper - uppercase a string (locale-aware)
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de toupper
+.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
+\\$*
+.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
+..
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" SH-xref - format a cross-reference to an SH section
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de SH-xref
+.ie n \{\
+.\}
+.toupper \\$*
+.el \{\
+\\$*
+.\}
+..
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" SH - level-one heading that works better for non-TTY output
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de1 SH
+.\" put an extra blank line of space above the head in non-TTY output
+.if t \{\
+.sp 1
+.\}
+.sp \\n[PD]u
+.nr an-level 1
+.set-an-margin
+.nr an-prevailing-indent \\n[IN]
+.fi
+.in \\n[an-margin]u
+.ti 0
+.HTML-TAG ".NH \\n[an-level]"
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+\." make the size of the head bigger
+.ps +3
+.ft B
+.ne (2v + 1u)
+.ie n \{\
+.\" if n (TTY output), use uppercase
+.toupper \\$*
+.\}
+.el \{\
+.nr an-break-flag 0
+.\" if not n (not TTY), use normal case (not uppercase)
+\\$1
+.in \\n[an-margin]u
+.ti 0
+.\" if not n (not TTY), put a border/line under subheading
+.sp -.6
+\l'\n(.lu'
+.\}
+..
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" SS - level-two heading that works better for non-TTY output
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de1 SS
+.sp \\n[PD]u
+.nr an-level 1
+.set-an-margin
+.nr an-prevailing-indent \\n[IN]
+.fi
+.in \\n[IN]u
+.ti \\n[SN]u
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.ps \\n[PS-SS]u
+\." make the size of the head bigger
+.ps +2
+.ft B
+.ne (2v + 1u)
+.if \\n[.$] \&\\$*
+..
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" BB/BE - put background/screen (filled box) around block of text
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de BB
+.if t \{\
+.sp -.5
+.br
+.in +2n
+.ll -2n
+.gcolor red
+.di BX
+.\}
+..
+.de EB
+.if t \{\
+.if "\\$2"adjust-for-leading-newline" \{\
+.sp -1
+.\}
+.br
+.di
+.in
+.ll
+.gcolor
+.nr BW \\n(.lu-\\n(.i
+.nr BH \\n(dn+.5v
+.ne \\n(BHu+.5v
+.ie "\\$2"adjust-for-leading-newline" \{\
+\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
+.\}
+.el \{\
+\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
+.\}
+.in 0
+.sp -.5v
+.nf
+.BX
+.in
+.sp .5v
+.fi
+.\}
+..
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" BM/EM - put colored marker in margin next to block of text
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.de BM
+.if t \{\
+.br
+.ll -2n
+.gcolor red
+.di BX
+.\}
+..
+.de EM
+.if t \{\
+.br
+.di
+.ll
+.gcolor
+.nr BH \\n(dn
+.ne \\n(BHu
+\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
+.in 0
+.nf
+.BX
+.in
+.fi
+.\}
+..
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
-.SH "NAME"
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "Name"
 onnode \- run commands on ctdb nodes
-.SH "SYNOPSIS"
-.HP 24
-\fBonnode NODE COMMAND ...\fR
+.SH "Synopsis"
+.fam C
+.HP \w'\fBonnode\ [OPTION]\ \&.\&.\&.\ NODES\ COMMAND\ \&.\&.\&.\fR\ 'u
+\fBonnode [OPTION] \&.\&.\&. NODES COMMAND \&.\&.\&.\fR
+.fam
 .SH "DESCRIPTION"
 .PP
-onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes.
+onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\&.
 .PP
-The NODE option specifies which node to run a command on. You can specify a numeric node number (from 0 to N\-1) or the special node 'all'.
+The NODES option specifies which node to run a command on\&. You can specify a numeric node number (from 0 to N\-1) or the special node \'all\'\&. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\&. If nodes are specified multiple times then the command will be executed multiple times on those nodes\&. The order of nodes is significant\&.
 .PP
-The COMMAND can be any shell command. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command.
+The COMMAND can be any shell command\&. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\&.
+.SH "OPTIONS"
 .PP
-If the COMMAND starts with a /, then the command is run via the 'at' service. Otherwise the command is run in the foreground.
+\-c
+.RS 4
+Execute COMMAND in the current working directory on each node\&.
+.RE
+.PP
+\-p
+.RS 4
+Run commands in parallel on the specified nodes\&. In this mode
+.RE
+.PP
+\-q
+.RS 4
+Do not print node addresses\&. Normally, onnode prints informational node addresses if more than one node is specified\&. This overrides \-v\&.
+.RE
+.PP
+\-v
+.RS 4
+Print a node addresses even if only one node is specified\&. Normally, onnode prints informational node addresses when more than one node is specified\&.
+.RE
+.PP
+\-h, \-\-help
+.RS 4
+Show a short usage guide\&.
+.RE
 .SH "EXAMPLES"
 .PP
 The following command would show the process ID of ctdb on all nodes
 .sp
+.if n \{\
 .RS 4
+.\}
+.fam C
+.ps -1
 .nf
-onnode all pidof ctdbd
-      
+.if t \{\
+.sp -1
+.\}
+.BB lightgray adjust-for-leading-newline
+.sp -1
+
+      onnode all pidof ctdbd
+    
+.EB lightgray adjust-for-leading-newline
+.if t \{\
+.sp 1
+.\}
+.fi
+.fam
+.ps +1
+.if n \{\
+.RE
+.\}
+.PP
+The following command would show the last 5 lines of log on each node, preceded by the node\'s hostname
+.sp
+.if n \{\
+.RS 4
+.\}
+.fam C
+.ps -1
+.nf
+.if t \{\
+.sp -1
+.\}
+.BB lightgray adjust-for-leading-newline
+.sp -1
+
+      onnode all "hostname; tail \-5 /var/log/log\&.ctdb"
+    
+.EB lightgray adjust-for-leading-newline
+.if t \{\
+.sp 1
+.\}
 .fi
+.fam
+.ps +1
+.if n \{\
 .RE
+.\}
 .PP
-The following command would show the last 5 lines of log on each node, preceded by the nodes hostname
+The following command would restart the ctdb service on all nodes\&.
 .sp
+.if n \{\
 .RS 4
+.\}
+.fam C
+.ps -1
 .nf
-onnode all "hostname; tail \-5 /var/log/log.ctdb"
-      
+.if t \{\
+.sp -1
+.\}
+.BB lightgray adjust-for-leading-newline
+.sp -1
+
+      onnode all service ctdb restart
+    
+.EB lightgray adjust-for-leading-newline
+.if t \{\
+.sp 1
+.\}
 .fi
+.fam
+.ps +1
+.if n \{\
 .RE
+.\}
 .PP
-The following command would restart the ctdb service on all nodes.
+The following command would run \&./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\&.
 .sp
+.if n \{\
 .RS 4
+.\}
+.fam C
+.ps -1
 .nf
-onnode all service ctdb restart
-      
+.if t \{\
+.sp -1
+.\}
+.BB lightgray adjust-for-leading-newline
+.sp -1
+
+      onnode \-c \-p 0,2\-4 \&./foo
+    
+.EB lightgray adjust-for-leading-newline
+.if t \{\
+.sp 1
+.\}
 .fi
+.fam
+.ps +1
+.if n \{\
+.RE
+.\}
+.SH "FILES"
+.PP
+/etc/ctdb/nodes
+.RS 4
+Contains a list of each node\'s IP address or hostname\&.
+.RE
+.PP
+/etc/ctdb/onnode\&.conf
+.RS 4
+If this file exists it is sourced by onnode\&. The main purpose is to allow the administrator to set $SSH to something other than "ssh"\&. In this case the \-t option is ignored\&. For example, the administrator may choose to use use rsh instead of ssh\&.
 .RE
 .SH "SEE ALSO"
 .PP
 ctdbd(1), ctdb(1),
-\fI\%http://ctdb.samba.org/\fR
+\m[blue]\fB\%http://ctdb.samba.org/\fR\m[]
 .SH "COPYRIGHT/LICENSE"
 .sp
+.if n \{\
 .RS 4
+.\}
+.fam C
+.ps -1
 .nf
+.if t \{\
+.sp -1
+.\}
+.BB lightgray adjust-for-leading-newline
+.sp -1
+
 Copyright (C) Andrew Tridgell 2007
 Copyright (C) Ronnie sahlberg 2007
+Copyright (C) Martin Schwenke 2008
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or (at
-your option) any later version.
+your option) any later version\&.
 
 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&.  See the GNU
+General Public License for more details\&.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, see http://www.gnu.org/licenses/.
+along with this program; if not, see http://www\&.gnu\&.org/licenses/\&.
+.EB lightgray adjust-for-leading-newline
+.if t \{\
+.sp 1
+.\}
 .fi
+.fam
+.ps +1
+.if n \{\
 .RE
+.\}
diff --git a/doc/onnode.1.html b/doc/onnode.1.html
index 57ddfec..1e9ca3e 100644
--- a/doc/onnode.1.html
+++ b/doc/onnode.1.html
@@ -1,34 +1,65 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode &#8212; run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode NODE COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2490457"></a><h2>DESCRIPTION</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode &#8212; run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2507976"></a><h2>DESCRIPTION</h2><p>
       onnode is a utility to run commands on a specific node of a CTDB
       cluster, or on all nodes.
     </p><p>
-      The NODE option specifies which node to run a command on. You
+      The NODES option specifies which node to run a command on. You
       can specify a numeric node number (from 0 to N-1) or the special
-      node 'all'.
+      node 'all'.  You can also specify lists of nodes, separated by
+      commas, and ranges of numeric node numbers, separated by dashes.
+      If nodes are specified multiple times then the command will be
+      executed multiple times on those nodes.  The order of nodes is
+      significant.
     </p><p>
       The COMMAND can be any shell command. The onnode utility uses
       ssh or rsh to connect to the remote nodes and run the command.
-      </p><p>
-      If the COMMAND starts with a /, then the command is run via the
-      'at' service. Otherwise the command is run in the foreground.
-    </p></div><div class="refsect1" lang="en"><a name="id2487793"></a><h2>EXAMPLES</h2><p>
+      </p></div><div class="refsect1" lang="en"><a name="id2508002"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
+            Execute COMMAND in the current working directory on each
+            node.
+	  </p></dd><dt><span class="term">-p</span></dt><dd><p>
+            Run commands in parallel on the specified nodes.  In this
+            mode 
+	  </p></dd><dt><span class="term">-q</span></dt><dd><p>
+            Do not print node addresses.  Normally, onnode prints
+            informational node addresses if more than one node is
+            specified.  This overrides -v.
+	  </p></dd><dt><span class="term">-v</span></dt><dd><p>
+            Print a node addresses even if only one node is specified.
+            Normally, onnode prints informational node addresses when
+            more than one node is specified.
+	  </p></dd><dt><span class="term">-h, --help</span></dt><dd><p>
+            Show a short usage guide.
+	  </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2511603"></a><h2>EXAMPLES</h2><p>
       The following command would show the process ID of ctdb on all nodes
-      </p><pre class="screen">
-onnode all pidof ctdbd
-      </pre><p>
+    </p><pre class="screen">
+      onnode all pidof ctdbd
+    </pre><p>
       The following command would show the last 5 lines of log on each
-      node, preceded by the nodes hostname
-      </p><pre class="screen">
-onnode all "hostname; tail -5 /var/log/log.ctdb"
-      </pre><p>
+      node, preceded by the node's hostname
+    </p><pre class="screen">
+      onnode all "hostname; tail -5 /var/log/log.ctdb"
+    </pre><p>
       The following command would restart the ctdb service on all nodes.
-      </p><pre class="screen">
-onnode all service ctdb restart
-      </pre></div><div class="refsect1" lang="en"><a name="id2488691"></a><h2>SEE ALSO</h2><p>
-      ctdbd(1), ctdb(1), <a href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
-    </p></div><div class="refsect1" lang="en"><a name="id2488704"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
+    </p><pre class="screen">
+      onnode all service ctdb restart
+    </pre><p>
+      The following command would run ./foo in the current working
+      directory, in parallel, on nodes 0, 2, 3 and 4.
+    </p><pre class="screen">
+      onnode -c -p 0,2-4 ./foo
+    </pre></div><div class="refsect1" lang="en"><a name="id2511652"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
+            Contains a list of each node's IP address or hostname.
+	  </p></dd><dt><span class="term">/etc/ctdb/onnode.conf</span></dt><dd><p>


-- 
CTDB repository


More information about the samba-cvs mailing list