From owner-freebsd-bugs@FreeBSD.ORG Sun May 18 01:10:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDC9AB30 for ; Sun, 18 May 2014 01:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A741E298F for ; Sun, 18 May 2014 01:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I1A08c001237 for ; Sun, 18 May 2014 01:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4I1A0wb001236; Sun, 18 May 2014 01:10:00 GMT (envelope-from gnats) Resent-Date: Sun, 18 May 2014 01:10:00 GMT Resent-Message-Id: <201405180110.s4I1A0wb001236@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tassilo Philipp Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C240CA66 for ; Sun, 18 May 2014 01:03:52 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A37F8294D for ; Sun, 18 May 2014 01:03:52 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I13qWq021379 for ; Sun, 18 May 2014 01:03:52 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4I13qgG021377; Sun, 18 May 2014 01:03:52 GMT (envelope-from nobody) Message-Id: <201405180103.s4I13qgG021377@cgiserv.freebsd.org> Date: Sun, 18 May 2014 01:03:52 GMT From: Tassilo Philipp To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/189904: new port: net-mgmt/guifi-snpservices X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 01:10:00 -0000 >Number: 189904 >Category: misc >Synopsis: new port: net-mgmt/guifi-snpservices >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 18 01:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Tassilo Philipp >Release: >Organization: >Environment: >Description: >How-To-Repeat: >Fix: Patch attached with submission follows: # 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: # # guifi-snpservices # guifi-snpservices/distinfo # guifi-snpservices/Makefile # guifi-snpservices/files # guifi-snpservices/files/patch-common-config.php.template # guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php # guifi-snpservices/files/patch-index.php # guifi-snpservices/files/patch-graphs-cnml2mrtgcsv.php # guifi-snpservices/files/patch-common-refresh_cnml.php # guifi-snpservices/files/patch-common-refresh_mrtg.php # guifi-snpservices/files/patch-common-qnodes.php # guifi-snpservices/files/patch-common-misc.php # guifi-snpservices/files/patch-common-ping.sh # guifi-snpservices/files/pkg-message.in # guifi-snpservices/files/pkg-install.in # guifi-snpservices/files/pkg-deinstall.in # guifi-snpservices/pkg-descr # guifi-snpservices/pkg-plist # echo c - guifi-snpservices mkdir -p guifi-snpservices > /dev/null 2>&1 echo x - guifi-snpservices/distinfo sed 's/^X//' >guifi-snpservices/distinfo << 'ed10da94de12b7219a0df453fc339c15' XSHA256 (snpservices_0.2.2-5.tar.gz) = b08d003221d9d5ad688602a973838a0f83b1c99022a11c1ed08a520de8debb51 XSIZE (snpservices_0.2.2-5.tar.gz) = 185825 ed10da94de12b7219a0df453fc339c15 echo x - guifi-snpservices/Makefile sed 's/^X//' >guifi-snpservices/Makefile << '369990556fded9a2da53542d82a6e191' X# Created by: Tassilo Philipp X# $FreeBSD$ X XPORTNAME= snpservices XDISTVERSION= 0.2.2-5 XCATEGORIES= www XMASTER_SITES= http://serveis.guifi.net/debian/guifi/ \ X http://www.potion-studios.com/ XPKGNAMEPREFIX= guifi- XDISTNAME= ${PORTNAME}_${DISTVERSION} X XMAINTAINER= tphilipp@potion-studios.com XCOMMENT= Graphics server for the guifi.net meshnet X XRUN_DEPENDS= mrtg:${PORTSDIR}/net-mgmt/mrtg \ X rrdtool:${PORTSDIR}/databases/rrdtool X XUSE_PHP= gd simplexml dom X XSNPSERVICES_RUNDIR?= /var/run/${PORTNAME} XSUB_FILES= pkg-install pkg-deinstall pkg-message XSUB_LIST= SNPSERVICES_RUNDIR=${SNPSERVICES_RUNDIR} X XWRKSRC= ${WRKDIR}/${PORTNAME}-0.2.2 XNO_BUILD= yes X Xdo-install: X ${MKDIR} ${STAGEDIR}${WWWDIR} X (cd ${WRKSRC} \ X && ${COPYTREE_SHARE} \* ${STAGEDIR}${WWWDIR}) X ${FIND} ${STAGEDIR}${WWWDIR} -type f -exec ${CHMOD} 644 '{}' + X X.include 369990556fded9a2da53542d82a6e191 echo c - guifi-snpservices/files mkdir -p guifi-snpservices/files > /dev/null 2>&1 echo x - guifi-snpservices/files/patch-common-config.php.template sed 's/^X//' >guifi-snpservices/files/patch-common-config.php.template << '795b5a47b8dc2db36ec4440a3c349b91' X--- common/config.php.template.orig 2014-02-21 15:53:13.000000000 +0000 X+++ common/config.php.template 2014-04-10 13:41:47.000000000 +0000 X@@ -1,10 +1,10 @@ X Description:ping X IP: %s X X-Target[%s_ping]: `/etc/mrtg/ping.sh %s` X+Target[%s_ping]: `sh '.$snp_path.'/common/ping.sh %s` X MaxBytes[%s_ping]: 2000 X Options[%s_ping]: growright,unknaszero,nopercent,gauge X LegendI[%s_ping]: Perduts % 795b5a47b8dc2db36ec4440a3c349b91 echo x - guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php sed 's/^X//' >guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php << '2edf2cf50fb15ad3cd5b856e271085c1' X--- graphs/mrtgcsv2mrtgcfg.php.orig 2014-02-21 15:53:13.000000000 +0000 X+++ graphs/mrtgcsv2mrtgcfg.php 2014-04-10 12:35:33.000000000 +0000 X@@ -1,9 +1,9 @@ X guifi-snpservices/files/patch-index.php << 'ad8874a45f303e7df6954797483824be' X--- ./index.php.orig 2012-05-11 16:46:51.000000000 -0500 X+++ ./index.php 2014-01-27 23:43:35.000000000 -0600 X@@ -5,6 +5,6 @@ X * Main call to CNML services X */ X X // Common Bootstrap X if (file_exists('common/config.php')) X include_once("common/config.php"); X@@ -91,6 +93,7 @@ X echo "Available services:\n"; X $fservices = glob('services/*.php'); X X+ $services = array(); X foreach ($fservices as $fservice) X $services[] .= basename($fservice,'.php'); X echo implode('|',$services); ad8874a45f303e7df6954797483824be echo x - guifi-snpservices/files/patch-graphs-cnml2mrtgcsv.php sed 's/^X//' >guifi-snpservices/files/patch-graphs-cnml2mrtgcsv.php << 'd1319018f1152e8caa9d8231835c9427' X--- graphs/cnml2mrtgcsv.php.orig 2014-04-10 12:35:09.000000000 +0000 X+++ graphs/cnml2mrtgcsv.php 2014-04-10 12:35:19.000000000 +0000 X@@ -267,7 +267,7 @@ X // Opening CNML source X $cnml = new DOMDocument; X $cnml->preserveWhiteSpace = false; X-$cnml->Load('../data/guifi.cnml'); X+$cnml->Load('/var/run/snpservices/data/guifi.cnml'); X $time_s = microtime(true); X //print "# file guifi.cnml loaded".($time_s - $time_start)."\n"; X d1319018f1152e8caa9d8231835c9427 echo x - guifi-snpservices/files/patch-common-refresh_cnml.php sed 's/^X//' >guifi-snpservices/files/patch-common-refresh_cnml.php << '503e1bc387e897472823ea2c4a4d977a' X--- common/refresh_cnml.php.orig 2014-04-10 12:41:40.000000000 +0000 X+++ common/refresh_cnml.php 2014-04-10 12:43:16.000000000 +0000 X@@ -27,14 +27,14 @@ X echo "Getting CNML file\n"; X $hcnml = @fopen($SNPDataServer_url."/guifi/cnml/".$rootZone."/detail", "r") X or die ('Error redaing CNML source\n'); X- $wcnml = @fopen("../data/guifi.cnml.tmp", "w"); X+ $wcnml = @fopen("/var/run/snpservices/data/guifi.cnml.tmp", "w"); X while (!feof($hcnml)) { X $buffer = fgets($hcnml, 4096); X fwrite($wcnml,$buffer); X } X fclose($hcnml); X fclose($wcnml); X- exec ("/bin/cp ../data/guifi.cnml.tmp ../data/guifi.cnml"); X+ exec ("/bin/cp /var/run/snpservices/data/guifi.cnml.tmp /var/run/snpservices/data/guifi.cnml"); X X $hlast= @fopen("/tmp/last_update.cnml", "w") or die('Error!'); X fwrite($hlast,$last_now); 503e1bc387e897472823ea2c4a4d977a echo x - guifi-snpservices/files/patch-common-refresh_mrtg.php sed 's/^X//' >guifi-snpservices/files/patch-common-refresh_mrtg.php << 'bc74c20e1732e73bd782f81d7d5c2080' X--- common/refresh_mrtg.php.orig 2014-04-10 12:44:08.000000000 +0000 X+++ common/refresh_mrtg.php 2014-04-10 12:44:27.000000000 +0000 X@@ -29,7 +29,7 @@ X X echo "Getting MRTG CSV file\n"; X $hcnml = @fopen($MRTGConfigSource, "r"); X- $wcnml = @fopen("../data/guifi_mrtg.csv", "w"); X+ $wcnml = @fopen("/var/run/snpservices/data/guifi_mrtg.csv", "w"); X while (!feof($hcnml)) { X $buffer = fgets($hcnml, 4096); X fwrite($wcnml,$buffer); bc74c20e1732e73bd782f81d7d5c2080 echo x - guifi-snpservices/files/patch-common-qnodes.php sed 's/^X//' >guifi-snpservices/files/patch-common-qnodes.php << '8fbc12eb20a6c552d3a7f04cbac830e9' X--- common/qnodes.php.orig 2014-04-10 12:44:55.000000000 +0000 X+++ common/qnodes.php 2014-04-10 12:45:28.000000000 +0000 X@@ -19,7 +19,7 @@ X // Opening CNML source X $doc = new DOMDocument; X $doc->preserveWhiteSpace = false; X-$doc->Load('../data/guifi.cnml'); X+$doc->Load('/var/run/snpservices/data/guifi.cnml'); X X // building the xpath query for requested nodes X $xpath = new DOMXPath($doc); 8fbc12eb20a6c552d3a7f04cbac830e9 echo x - guifi-snpservices/files/patch-common-misc.php sed 's/^X//' >guifi-snpservices/files/patch-common-misc.php << 'a93a525b8293a442999eeea64970e703' X--- common/misc.php.orig 2014-04-10 14:05:20.000000000 +0000 X+++ common/misc.php 2014-04-10 14:05:45.000000000 +0000 X@@ -177,7 +177,7 @@ X foreach ($an as $nc) { X $try = 0; X $xml = false; X- $fn = $prefix.'tmp/'.$nc.'.cnml'; X+ $fn = $prefix.'/var/run/snpservices/tmp/'.$nc.'.cnml'; X do { X // print " Processing $nc try $try cache: $waitcache\n
"; X if (file_exists($fn)) { X@@ -232,7 +232,7 @@ X if ($xml) { X $xpnxml = $xml->xpath('//node'); X foreach ($xpnxml as $nxml) { X- $fn = $prefix.'tmp/'.$nxml->attributes()->id.'.cnml'; X+ $fn = $prefix.'/var/run/snpservices/tmp/'.$nxml->attributes()->id.'.cnml'; X $wcnml = @fopen($fn, "w+") or die("\n
Error caching XML, can't write $fn\n"); X fwrite($wcnml,''.$nxml->asXML().''); X fclose($wcnml); a93a525b8293a442999eeea64970e703 echo x - guifi-snpservices/files/patch-common-ping.sh sed 's/^X//' >guifi-snpservices/files/patch-common-ping.sh << '958748ef81ec95b49d64295f723cfdb2' X--- ./common/ping.sh.orig 2014-02-21 15:53:13.000000000 +0000 X+++ ./common/ping.sh 2014-04-10 14:19:56.000000000 +0000 X@@ -1,15 +1,15 @@ X #!/bin/sh X- PING="/bin/ping" X+ PING="/sbin/ping" X ADDR=$1 X- DATA=`$PING -c5 -i 0.2 $ADDR -q -W 4` X+ DATA=`$PING -c 5 -i 0.2 -q -W 4 $ADDR` X LOSS=`echo $DATA | awk '{print $18 }' | tr -d %` X ERRORS=`echo $DATA | awk '{print $19 }' | tr -d %` X- if [ $ERRORS = "errors," ] X+ if [ "$ERRORS" = "errors," ] X then X LOSS=`echo $DATA | awk '{print $20 }' | tr -d %` X fi X echo $LOSS X- if [ $LOSS = 100 ]; X+ if [ "$LOSS" = 100 ]; X then X echo 0 X else 958748ef81ec95b49d64295f723cfdb2 echo x - guifi-snpservices/files/pkg-message.in sed 's/^X//' >guifi-snpservices/files/pkg-message.in << 'db54c67ab8492ca7a48693a4785d95db' X XPOST-INSTALL CONFIGURATION FOR GUIFI SNPSERVICES X------------------------------------------------ X X1) Install and/or configure a webserver of your choice to serve X php files from %%WWWDIR%%/ (you also might have to X increase your webserver's upstream timeout for certain requests X X2) Edit %%WWWDIR%%/common/config.php.template and set X $SNPGraphServerId to your service's ID (note, it's the *service*, X NOT the "server" ID) X X3) setup a cronjob to keep your graphs and stats up to date; for X example: X X*/30 * * * * root if [ -x %%WWWDIR%%/graphs ]; then cd %%WWWDIR%%/graphs; fi; if [ -x %%PREFIX%%/bin/php ] && [ -r %%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php ]; then env LANG=C %%PREFIX%%/bin/php mrtgcsv2mrtgcfg.php >> /var/log/snpservices_mrtgcfg.log 2>&1; fi X*/5 * * * * root if [ -x %%PREFIX%%/bin/mrtg ] && [ -r /var/run/snpservices/data/mrtg.cfg ]; then env LANG=C %%PREFIX%%/bin/mrtg /var/run/snpservices/data/mrtg.cfg --lock-file /var/run/mrtg/lockfile_guifi >> /var/log/snpservices_mrtg.log 2>&1; fi X X4) consider logrotating /var/log/snpservices_*.log X XFor more information, see various guifi.net doc pages, and related: X X http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas X http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas_1 X http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas_2 X http://www3.uji.es/~vrubert/guifi_linux/graph.html#slide1 X http://es.wiki.guifi.net/wiki/Monitor X http://guifi.net/ca/node/9071 X X------------------------------------------------ X db54c67ab8492ca7a48693a4785d95db echo x - guifi-snpservices/files/pkg-install.in sed 's/^X//' >guifi-snpservices/files/pkg-install.in << '0153a2dbd16526d63594ffaa2736c51b' X#!/bin/sh XCHMOD="/bin/chmod" XMKDIR="/bin/mkdir -p" X XSNPSERVICES_RUNDIR=%%SNPSERVICES_RUNDIR%% X Xcase "$2" in X XPOST-INSTALL) X if [ ! -d "${SNPSERVICES_RUNDIR}/images" ]; then X ${MKDIR} "${SNPSERVICES_RUNDIR}/images" X fi X if [ ! -d "${SNPSERVICES_RUNDIR}/logs" ]; then X ${MKDIR} "${SNPSERVICES_RUNDIR}/logs" X fi X if [ ! -d "${SNPSERVICES_RUNDIR}/data" ]; then X ${MKDIR} "${SNPSERVICES_RUNDIR}/data" X fi X if [ ! -d "${SNPSERVICES_RUNDIR}/tmp" ]; then X ${MKDIR} "$SNPSERVICES_RUNDIR" X ${MKDIR} "${SNPSERVICES_RUNDIR}/tmp" X ${CHMOD} -R a+rw ${SNPSERVICES_RUNDIR}/tmp X fi X ;; Xesac Xexit 0 0153a2dbd16526d63594ffaa2736c51b echo x - guifi-snpservices/files/pkg-deinstall.in sed 's/^X//' >guifi-snpservices/files/pkg-deinstall.in << '6f94cf7de5211c8bfca8b5a54913b9fa' X#!/bin/sh Xrm -rf %%SNPSERVICES_RUNDIR%% 6f94cf7de5211c8bfca8b5a54913b9fa echo x - guifi-snpservices/pkg-descr sed 's/^X//' >guifi-snpservices/pkg-descr << '78b7910512ea46dd2f3f42e486d0e559' XThis is the guifi.net snpservices package. X XThis software provides graph services in the context of the XSpontaneous Networklink Platform. X XUses nodexchange/cnml as a input format, and provides traffic and Xlatency/availability graphs in image format by using mrtg/rrdtool Xcollected history by simple HTTP URLs, therefore is easily Xplugable to any web application. X XWWW: http://es.wiki.guifi.net/wiki/SNPservices 78b7910512ea46dd2f3f42e486d0e559 echo x - guifi-snpservices/pkg-plist sed 's/^X//' >guifi-snpservices/pkg-plist << '3899d4a662bcbb996243347f2cd13d5b' X%%WWWDIR%%/README X%%WWWDIR%%/common/cnml2ov2.php X%%WWWDIR%%/common/config.php.template X%%WWWDIR%%/common/config.php.template.orig X%%WWWDIR%%/common/misc.php X%%WWWDIR%%/common/misc.php.orig X%%WWWDIR%%/common/mrtg.sh X%%WWWDIR%%/common/ping.sh X%%WWWDIR%%/common/ping.sh.orig X%%WWWDIR%%/common/qnodes.php X%%WWWDIR%%/common/qnodes.php.orig X%%WWWDIR%%/common/refresh.sh X%%WWWDIR%%/common/refresh_cnml.php X%%WWWDIR%%/common/refresh_cnml.php.orig X%%WWWDIR%%/common/refresh_mrtg.php X%%WWWDIR%%/common/refresh_mrtg.php.orig X%%WWWDIR%%/common/rrdtool.php X%%WWWDIR%%/debian/README.Debian X%%WWWDIR%%/debian/changelog X%%WWWDIR%%/debian/compat X%%WWWDIR%%/debian/control X%%WWWDIR%%/debian/copyright X%%WWWDIR%%/debian/cron.d X%%WWWDIR%%/debian/dirs X%%WWWDIR%%/debian/docs X%%WWWDIR%%/debian/rules X%%WWWDIR%%/debian/snpservices.1 X%%WWWDIR%%/debian/snpservices.config X%%WWWDIR%%/debian/snpservices.install X%%WWWDIR%%/debian/snpservices.logrotate X%%WWWDIR%%/debian/snpservices.manpages X%%WWWDIR%%/debian/snpservices.postinst X%%WWWDIR%%/debian/snpservices.postrm X%%WWWDIR%%/debian/snpservices.templates X%%WWWDIR%%/debian/watch.ex X%%WWWDIR%%/graphs/LICENSE.txt X%%WWWDIR%%/graphs/cnml2mrtgcsv.php X%%WWWDIR%%/graphs/cnml2mrtgcsv.php.orig X%%WWWDIR%%/graphs/config.php X%%WWWDIR%%/graphs/graphs.php X%%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php X%%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php.orig X%%WWWDIR%%/graphs/refresh.php X%%WWWDIR%%/index.php X%%WWWDIR%%/index.php.orig X%%WWWDIR%%/misc/xml2ov2.php X%%WWWDIR%%/services/availability.php X%%WWWDIR%%/services/example.php X%%WWWDIR%%/services/graph.php X%%WWWDIR%%/services/liveping.php X%%WWWDIR%%/services/livetraceroute.php X%%WWWDIR%%/services/stats.php X%%WWWDIR%%/tools/guinux/config.php.guinux X%%WWWDIR%%/tools/guinux/snpconfig.pl X%%WWWDIR%%/tools/guinux/snpservices.conf X@dirrmtry %%WWWDIR%%/tools/guinux X@dirrmtry %%WWWDIR%%/tools X@dirrmtry %%WWWDIR%%/services X@dirrmtry %%WWWDIR%%/misc X@dirrmtry %%WWWDIR%%/graphs X@dirrmtry %%WWWDIR%%/debian X@dirrmtry %%WWWDIR%%/common X@dirrmtry %%WWWDIR%% 3899d4a662bcbb996243347f2cd13d5b exit >Release-Note: >Audit-Trail: >Unformatted: