Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2005 18:10:55 +0100 (CET)
From:      Janos Mohacsi <janos.mohacsi@bsd.hu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/76510: [NEW PORT] sysutils/fanout: Allow you to run commands on multiple machines
Message-ID:  <200501201710.j0KHAtkT017151@scone.ki.iif.hu>
Resent-Message-ID: <200501201720.j0KHKHjc044118@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         76510
>Category:       ports
>Synopsis:       [NEW PORT] sysutils/fanout: Allow you to run commands on multiple machines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 20 17:20:17 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Janos Mohacsi
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
NIIF/HUNGARNET
>Environment:
System: FreeBSD scone.ki.iif.hu 5.3-STABLE FreeBSD 5.3-STABLE #5: Thu Nov 11 05:45:29 CET 2004
>Description:
Fanout and fanterm are two utilities that allow you to run commands on 
multiple machines. The difference is that fanout only runs non-interactive 
commands (like dd, cat, adduser, uname -a, etc.) and pipelines built of 
these. The output is collected into a single display that can be viewed by 
less or redirected to a file.

Fanterm, on the other hand, allows you to run interactive text mode 
commands on multiple machines at the same time. Your keystrokes are sent 
to a shell or application running on each of the target systems. The 
output from each system is shown in a seperate xterm.

WWW: http://www.stearns.org/fanout/

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- fanout-0.6.1.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	fanout
#	fanout/distinfo
#	fanout/pkg-descr
#	fanout/Makefile
#	fanout/files
#	fanout/files/patch-fanout
#	fanout/files/patch-fanterm
#	fanout/files/patch-fanmux
#
echo c - fanout
mkdir -p fanout > /dev/null 2>&1
echo x - fanout/distinfo
sed 's/^X//' >fanout/distinfo << 'END-of-fanout/distinfo'
XMD5 (fanout-0.6.1.tar.gz) = 82addf30b2e0cc6f0d203c9a99b20210
XSIZE (fanout-0.6.1.tar.gz) = 299030
END-of-fanout/distinfo
echo x - fanout/pkg-descr
sed 's/^X//' >fanout/pkg-descr << 'END-of-fanout/pkg-descr'
XFanout and fanterm are two utilities that allow you to run commands on 
Xmultiple machines. The difference is that fanout only runs non-interactive 
Xcommands (like dd, cat, adduser, uname -a, etc.) and pipelines built of 
Xthese. The output is collected into a single display that can be viewed by 
Xless or redirected to a file.
X
XFanterm, on the other hand, allows you to run interactive text mode 
Xcommands on multiple machines at the same time. Your keystrokes are sent 
Xto a shell or application running on each of the target systems. The 
Xoutput from each system is shown in a seperate xterm.
X
XWWW: http://www.stearns.org/fanout/
END-of-fanout/pkg-descr
echo x - fanout/Makefile
sed 's/^X//' >fanout/Makefile << 'END-of-fanout/Makefile'
X# New ports collection makefile for:	fanout
X# Date created:				20.01.2005
X# Whom:					janos.mohacsi@bsd.hu
X#
X# $FreeBSD$
X#
X
XPORTNAME=	fanout
XPORTVERSION=	0.6.1
XCATEGORIES=	sysutils
XMASTER_SITES=	http://www.stearns.org/fanout/ \
X		ftp://ftp.bascom.com/pub/wstearns/fanout/ \
X		http://www.linuxgrill.com/anonymous/mirrors/wstearns/fanout/
X
XMAINTAINER=	janos.mohacsi@bsd.hu
XCOMMENT=	Allow you to run commands on multiple machines
X
XUSE_PERL5_RUN=	yes
XNO_BUILD=	yes
XUSE_REINPLACE=	yes
XPLIST_FILES=	bin/fanout bin/fanterm bin/fanmux
XPORTDOCS=	README index.html
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' \
X		${WRKSRC}/fanterm
X	@${REINPLACE_CMD} -e 's,%%PERL%%,${PERL},g' \
X		${WRKSRC}/fanmux
X
Xdo-install:
X	${INSTALL_SCRIPT} ${WRKSRC}/fanout ${PREFIX}/bin/
X	${INSTALL_SCRIPT} ${WRKSRC}/fanterm ${PREFIX}/bin/
X	${INSTALL_SCRIPT} ${WRKSRC}/fanmux ${PREFIX}/bin/
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
X.endif
X
X.include <bsd.port.mk>
END-of-fanout/Makefile
echo c - fanout/files
mkdir -p fanout/files > /dev/null 2>&1
echo x - fanout/files/patch-fanout
sed 's/^X//' >fanout/files/patch-fanout << 'END-of-fanout/files/patch-fanout'
X
X$FreeBSD$
X
X--- fanout.orig
X+++ fanout
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/bin/sh
X #Copyright 2000, 2001, 2002, 2003 William Stearns <wstearns@pobox.com>
X #GPL'd, of course.
X #Version 0.6.1, 8/7/2002
X@@ -23,6 +23,7 @@
X 	echo "Usage:"											>/dev/stderr
X 	echo "  $0 \"MACHINES\" \"commands and parameters to run on each machine\""			>/dev/stderr
X 	echo "  $0 -h	#Show this help"								>/dev/stderr
X+	echo "  $0 --noping	# Do not ping before running command"								>/dev/stderr
X 	echo												>/dev/stderr
X 	echo "Examples:"										>/dev/stderr
X 	echo "  fanout \"wstearns@localhost localhost anotherhost.someplace.net\" \\"			>/dev/stderr
X@@ -38,8 +39,7 @@
X 	echo												>/dev/stderr
X 	echo "  export SERVERS=\"web1 web2 mail\""							>/dev/stderr
X 	echo "  fanout \"\$SERVERS \" \"uname -a ; ( if [ -f /var/log/dmesg ]; then \\"			>/dev/stderr
X-	echo "   cat /var/log/dmesg ; else dmesg ; fi ) | egrep -i '(hd[a-h]|sd[a-h])' ; ls -al \\"	>/dev/stderr
X-	echo "   /proc/kcore ; cat /proc/cpuinfo\" >serverspecs"					>/dev/stderr
X+	echo "   cat /var/log/dmesg ; else dmesg ; fi ) | egrep -i '(hd[a-h]|sd[a-h])' "	>/dev/stderr
X 	exit
X }
X 
X@@ -65,20 +65,11 @@
X 		;;
X 	esac
X 
X-	if type -path mktemp >/dev/null 2>/dev/null ; then
X-		TMPFILE=`mktemp -q /tmp/fanout.XXXXXX`
X-		if [ $? -ne 0 ]; then
X-			echo "$0: Can't create temp file ${TMPFILE}." >/dev/stderr
X-			exit 1
X-		fi
X-	else
X-		TMPFILE="/tmp/fanout.$MYPID.$ONETARGET.$RANDOM"
X-		touch $TMPFILE
X+	TMPFILE=`mktemp -q /tmp/fanout.XXXXXX`
X 		if [ $? -ne 0 ]; then
X 			echo "$0: Can't create temp file ${TMPFILE}." >/dev/stderr
X 			exit 1
X 		fi
X-	fi
X 	OUTFILES="$OUTFILES $TMPFILE"						#Remember the filename for later display, cleanup
X 	if [ "$PING" = "NO" ] || ping -c 3 $ONEMACH >/dev/null 2>/dev/null ; then
X 		echo Starting $ONETARGET >/dev/stderr				#Machine is reachable
END-of-fanout/files/patch-fanout
echo x - fanout/files/patch-fanterm
sed 's/^X//' >fanout/files/patch-fanterm << 'END-of-fanout/files/patch-fanterm'
X
X$FreeBSD$
X
X--- fanterm.orig
X+++ fanterm
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/bin/sh
X #Copyright 2002, 2003 William Stearns <wstearns@pobox.com>
X #Released under the GPL
X #V0.6.1
X@@ -19,11 +19,6 @@
X trap FanTermCleanup SIGINT         #Ctrl-C generates this
X 
X 
X-if ! type -path mktemp >/dev/null 2>/dev/null ; then
X-	echo "Sorry, no mktemp utility, exiting." >&2
X-	exit 1
X-fi
X-
X if [ -z "$1" ]; then
X 	echo Usage: >&2
X 	echo "$0 ssh_host [ssh_host]..." >&2
X@@ -45,13 +40,13 @@
X 				echo "$0: Can't create temp file $InPipe." >&2
X 				exit 1
X 			fi
X-			mknod --mode=600 $InPipe p
X+			mkfifo -m 600 $InPipe
X 			OutPipe=`mktemp -q -u /tmp/fanout.XXXXXX`
X 			if [ $? -ne 0 ]; then
X 				echo "$0: Can't create temp file $OutPipe." >&2
X 				exit 1
X 			fi
X-			mknod --mode=600 $OutPipe p
X+			mkfifo -m 600 $OutPipe
X 		
X 			InPipes="$InPipes $InPipe"
X 			OutPipes="$OutPipes $OutPipe"
X@@ -62,7 +57,7 @@
X 	fi
X done
X 
X-fanmux $InPipes
X+%%LOCALBASE%%/bin/fanmux $InPipes
X 
X wait
X 
END-of-fanout/files/patch-fanterm
echo x - fanout/files/patch-fanmux
sed 's/^X//' >fanout/files/patch-fanmux << 'END-of-fanout/files/patch-fanmux'
X--- fanmux.orig	Thu Jan 20 17:40:25 2005
X+++ fanmux	Thu Jan 20 17:41:21 2005
X@@ -1,4 +1,4 @@
X-#!/usr/bin/perl
X+#!%%PERL%%
X #Copyright 2003, William Stearns <wstearns@pobox.com>
X #Released under the GPL
X #V0.6.1
END-of-fanout/files/patch-fanmux
exit
--- fanout-0.6.1.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501201710.j0KHAtkT017151>