svn commit: r564684 - in head/net/rtg: . files

Rainer Hurling rhurlin at FreeBSD.org
Mon Feb 8 09:25:20 UTC 2021


Author: rhurlin
Date: Mon Feb  8 09:25:18 2021
New Revision: 564684
URL: https://svnweb.freebsd.org/changeset/ports/564684

Log:
  net/rtg: Update to 0.7.5
  
  * Updated to latest cgilib (0.7)
  * Removed old GD/PNG/ZLIB bundled libraries for ease of upgrading
  * Added -b (background/daemonise) flag to rtgpoll
  * Added -p <file> (PID file) flag to rtgpoll
  * Added graph titles and legends to rtgplot
  * Updated PHP scripts from ancient mysql to newer mysqli library
  * Fixed many potential SQL injection and other vulnerabilities
  * Updated MySQL support to compile against MySQL 8.0+
  * Updated MySQL support to use mysql_config to pull in
    CFLAGS/LDFLAGS required depending on MySQL build
  * Updated MySQL table schemas to support clustered MySQL setups
  * Updated MySQL table schemas to improve speed (indexes)
  * Added MySQL option to auto-reconnect if MySQL server goes away
  * Changed default SNMP version to 2
  * Removed deprecated SNMP library options
  * Added 'Update_desc' option to rtg.con to auto-update interface
    descriptions
  * Fixed all compilation warnings, even when compiling with
    -pedantic -Wall -Werror
  * Push config into sysconfdir and web utils into htmldir
  * Added -u <user> -g <group> options for rtgpoll to run as user
    instead of root
  * Added -r <path> chroot option
  
  No changelog, only NEWS file
  
  PR:		253311
  Submitted by:	Daniel Austin <freebsd-ports at dan.me.uk> (maintainer)
  Approved by:	arrowd (mentor)
  Differential Revision:	https://reviews.freebsd.org/D28523

Deleted:
  head/net/rtg/files/patch-cgilib-0.4_cgi.c
  head/net/rtg/files/patch-config_config.h.in
  head/net/rtg/files/patch-configure
  head/net/rtg/files/patch-etc_95.php
  head/net/rtg/files/patch-etc_Makefile.in
  head/net/rtg/files/patch-etc_SNMP__util.pm
  head/net/rtg/files/patch-etc_createdb.in
  head/net/rtg/files/patch-etc_rtg.conf
  head/net/rtg/files/patch-etc_rtg.php
  head/net/rtg/files/patch-etc_view.php
  head/net/rtg/files/patch-man_rtgplot.1
  head/net/rtg/files/patch-man_rtgpoll.1
  head/net/rtg/files/patch-src_rtg.h
  head/net/rtg/files/patch-src_rtgplot.c
  head/net/rtg/files/patch-src_rtgplot.h
  head/net/rtg/files/patch-src_rtgpoll.c
  head/net/rtg/files/patch-src_rtgsnmp.c
  head/net/rtg/files/patch-src_rtgutil.c
Modified:
  head/net/rtg/Makefile
  head/net/rtg/distinfo
  head/net/rtg/files/patch-etc_95.pl
  head/net/rtg/files/patch-etc_common.php.in
  head/net/rtg/files/patch-etc_report.pl
  head/net/rtg/files/patch-etc_rtgtargmkr.pl.in
  head/net/rtg/files/rtgpoll.in
  head/net/rtg/pkg-plist

Modified: head/net/rtg/Makefile
==============================================================================
--- head/net/rtg/Makefile	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/Makefile	Mon Feb  8 09:25:18 2021	(r564684)
@@ -2,18 +2,17 @@
 # $FreeBSD$
 
 PORTNAME=	rtg
-PORTVERSION=	0.7.4
-PORTREVISION=	21
+PORTVERSION=	0.7.5
 CATEGORIES=	net
-MASTER_SITES=	SF \
-		ftp://ftpmirror.uk/freebsd-ports/rtg/
+MASTER_SITES=	ftp://ftpmirror.uk/freebsd-ports/rtg/
 
 MAINTAINER=	freebsd-ports at dan.me.uk
 COMMENT=	Flexible, high-performance SNMP statistics monitoring system
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
+LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp \
+		libgd.so:graphics/gd
 RUN_DEPENDS=	p5-DBI>=0:databases/p5-DBI \
 		p5-DBD-mysql>=0:databases/p5-DBD-mysql
 
@@ -21,31 +20,30 @@ USES=		mysql:client perl5 shebangfix ssl
 USE_RC_SUBR=	rtgpoll
 
 SHEBANG_FILES=	etc/95.pl etc/report.pl etc/rtgtargmkr.pl.in
-SUB_FILES=	pkg-message
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=	--sysconfdir=${PREFIX}/etc/${PORTNAME} \
+			--htmldir=${PREFIX}/www/data \
 			--with-mysql=${LOCALBASE} \
+			--with-gd=${LOCALBASE} \
 			--with-snmp=${LOCALBASE}
 
+CFLAGS+=	-fstack-protector
+LDFLAGS+=	-fstack-protector
+
 USERS=		rtg
 GROUPS=		rtg
 
 OPTIONS_DEFINE=	WEB MYSQL
-OPTIONS_DEFAULT=WEB
 MYSQL_DESC=	Pull MySQL server in as a dependancy for local setups
 WEB_DESC=	Include PHP-based web client interface pre-requisites
 
 MYSQL_USES=	mysql:server
 
-WEB_USES=	php
-WEB_USE=	PHP=mysqli,spl
+WEB_USES=		php
+WEB_USE=		PHP=mysqli,spl
+WEB_SUB_FILES=		pkg-message
 
-CFLAGS+=	-fstack-protector
-LDFLAGS+=	-fstack-protector
-
 post-patch:
-	@${MV} ${WRKSRC}/etc/rtg.conf ${WRKSRC}/etc/rtg.conf.sample
-	@${MV} ${WRKSRC}/etc/routers ${WRKSRC}/etc/routers.sample
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/95.pl
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/report.pl
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/common.php.in

Modified: head/net/rtg/distinfo
==============================================================================
--- head/net/rtg/distinfo	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/distinfo	Mon Feb  8 09:25:18 2021	(r564684)
@@ -1,2 +1,3 @@
-SHA256 (rtg-0.7.4.tar.gz) = db0dfefe335d551aaaa3e60876a1431916e7db55c980902413711512dd2132a0
-SIZE (rtg-0.7.4.tar.gz) = 710621
+TIMESTAMP = 1612622708
+SHA256 (rtg-0.7.5.tar.gz) = c0f4632e26423689037634ed59194dbfb017af57079b9039e33381d3698d6fe8
+SIZE (rtg-0.7.5.tar.gz) = 269657

Modified: head/net/rtg/files/patch-etc_95.pl
==============================================================================
--- head/net/rtg/files/patch-etc_95.pl	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/files/patch-etc_95.pl	Mon Feb  8 09:25:18 2021	(r564684)
@@ -1,4 +1,4 @@
---- etc/95.pl.orig	2018-04-02 20:14:41 UTC
+--- etc/95.pl.orig	2020-09-23 14:55:01 UTC
 +++ etc/95.pl
 @@ -31,7 +31,7 @@ $pass="rtgdefault";
  $onedaysec=60*60*24;
@@ -9,52 +9,3 @@
  foreach $conf (@configs) {
    if (open CONF, "<$conf") {
      print "Reading [$conf].\n" if $DEBUG;
-@@ -207,13 +207,13 @@ print "Period: [", format_dt($startdate)
- write;
- ($name,$router, $ratein, $rateout, $maxratein, $maxrateout, $nfratein, $nfrateout) = ("Connection", "", "Mbps", "Mbps", "Mbps", "Mbps", "Mbps", "Mbps");
- write;
--print "--------------------------------------------------------------------------------\n";
-+print "----------------------------------------------------------------------------------------------------\n";
- 
- $dbh= DBI->connect("DBI:mysql:$db:host=$host", $user, $pass);
- $dbh2= DBI->connect("DBI:mysql:$db:host=$host", $user, $pass);
--$range="dtime>$startdate and dtime<=$enddate";
-+$range="`dtime`>$startdate AND `dtime`<=$enddate";
- 
--$statement="SELECT id FROM interface WHERE description LIKE \"%$cust%\"";
-+$statement="SELECT `id` FROM `interface` WHERE `description` LIKE \"%$cust%\"";
- $sth = $dbh->prepare($statement)
-   or die "Can't prepare $statement: $dbh->errstr\n";
- $rv = $sth->execute
-@@ -223,19 +223,19 @@ while (@row = $sth->fetchrow_array ()) {
- }
- 
- foreach $interface (@interfaces) {
--  $statement="SELECT rid, name, speed FROM interface WHERE id=$interface";
-+  $statement="SELECT `rid`, `name`, `speed` FROM `interface` WHERE `id`=$interface";
-   &run_query($statement);
-   ($rid, $name, $speed) = @row;
- 
--  $statement="SELECT rid, name FROM router WHERE rid=$rid";
-+  $statement="SELECT `rid`, `name` FROM `router` WHERE `rid`=$rid";
-   &run_query($statement);
-   ($rid, $router) = @row;
- 
--  $statement="SELECT counter, UNIX_TIMESTAMP(dtime), dtime FROM ifInOctets_".$rid." WHERE $range AND id=$interface ORDER BY dtime"; 
-+  $statement="SELECT `counter`, UNIX_TIMESTAMP(`dtime`), `dtime` FROM `ifInOctets_".$rid."` WHERE $range AND `id`=$interface ORDER BY `dtime`"; 
-   ($intbytes_in, $maxin, $avgin, $nfin) = &interface_stats($statement);
-   $bytesin = int($intbytes_in/1000000 + .5);
- 
--  $statement="SELECT counter, UNIX_TIMESTAMP(dtime), dtime FROM ifOutOctets_".$rid." WHERE $range AND id=$interface ORDER BY dtime"; 
-+  $statement="SELECT `counter`, UNIX_TIMESTAMP(`dtime`), `dtime` FROM `ifOutOctets_".$rid."` WHERE $range AND `id`=$interface ORDER BY `dtime`"; 
-   ($intbytes_out, $maxout, $avgout, $nfout) = &interface_stats($statement);
-   $bytesout = int($intbytes_out/1000000 + .5);
- 
-@@ -279,6 +279,6 @@ $rc = $dbh->disconnect;
- exit;
- 
- format STDOUT = 
--@<<<<<<<<<<< @<<<<<<<<<<< @>>>>>>>  @>>>>>>>  @>>>>>>  @>>>>>>  @>>>>>>  @>>>>>>
-+@<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<< @>>>>>>>  @>>>>>>>  @>>>>>>  @>>>>>>  @>>>>>>  @>>>>>>
- $name,$router, $ratein, $rateout, $maxratein, $maxrateout, $nfratein, $nfrateout  
- .

Modified: head/net/rtg/files/patch-etc_common.php.in
==============================================================================
--- head/net/rtg/files/patch-etc_common.php.in	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/files/patch-etc_common.php.in	Mon Feb  8 09:25:18 2021	(r564684)
@@ -1,22 +1,10 @@
---- etc/common.php.in.orig	2003-09-26 15:52:29 UTC
+--- etc/common.php.in.orig	2020-09-22 19:52:22 UTC
 +++ etc/common.php.in
-@@ -1,4 +1,4 @@
--<?
-+<?php
-  /* Begin with reasonable defaults */
-  $VERSION = "@VERSION@";
-  $host="localhost";
-@@ -6,10 +6,13 @@
-  $pass="rtgdefault";
-  $db="rtg";
-  $refresh=300;
-+
-+ date_default_timezone_set ( 'UTC' );
-  
-  /* Default locations to find RTG configuration file */
-  $configs[] = 'rtg.conf';
-  $configs[] = '@RTG_HOME@/etc/rtg.conf';
-+ $configs[] = '%%PREFIX%%/etc/rtg/rtg.conf';
-  $configs[] = '/usr/local/rtg/etc/rtg.conf';
-  $configs[] = '/etc/rtg.conf';
+@@ -12,6 +12,7 @@ date_default_timezone_set('UTC');
+ /* Default locations to find RTG configuration file */
+ $configs[] = 'rtg.conf';
+ $configs[] = '@RTG_HOME@/etc/rtg.conf';
++$configs[] = '%%PREFIX%%/etc/rtg/rtg.conf';
+ $configs[] = '/usr/local/rtg/etc/rtg.conf';
+ $configs[] = '/etc/rtg.conf';
  

Modified: head/net/rtg/files/patch-etc_report.pl
==============================================================================
--- head/net/rtg/files/patch-etc_report.pl	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/files/patch-etc_report.pl	Mon Feb  8 09:25:18 2021	(r564684)
@@ -1,4 +1,4 @@
---- etc/report.pl.orig	2018-04-02 20:14:41 UTC
+--- etc/report.pl.orig	2020-09-23 14:55:01 UTC
 +++ etc/report.pl
 @@ -30,7 +30,7 @@ $pass="rtgdefault";
  $onedaysec=60*60*24;
@@ -9,52 +9,3 @@
  foreach $conf (@configs) {
    if (open CONF, "<$conf") {
      print "Reading [$conf].\n" if $DEBUG;
-@@ -192,13 +192,13 @@ print "Period: [", format_dt($startdate)
- write;
- ($router,$name,$bytesin, $bytesout, $ratein, $rateout, $utilin, $utilout, $maxratein, $maxrateout, $maxutilin, $maxutilout) = ("","Connection", "MBytes", "MBytes", "Mbps", "Mbps", "In %", "Out%",  "Mbps", "Mbps", "In%", "Out%");
- write;
--print "----------------------------------------------------------------------------------------------------------\n";
-+print "------------------------------------------------------------------------------------------------------------------------------\n";
- 
- $dbh= DBI->connect("DBI:mysql:$db:host=$host", $user, $pass);
- $dbh2= DBI->connect("DBI:mysql:$db:host=$host", $user, $pass);
--$range="dtime>$startdate and dtime<=$enddate";
-+$range="`dtime`>$startdate and `dtime`<=$enddate";
- 
--$statement="SELECT id FROM interface WHERE description LIKE \"%$cust%\"";
-+$statement="SELECT `id` FROM `interface` WHERE `description` LIKE \"%$cust%\"";
- $sth = $dbh->prepare($statement)
-         or die "Can't prepare $statement: $dbh->errstr\n";
- $rv = $sth->execute
-@@ -209,19 +209,19 @@ while (@row = $sth->fetchrow_array ())
- }
- 
- foreach $interface (@interfaces) {
--  $statement="SELECT rid, name, speed FROM interface WHERE id=$interface";
-+  $statement="SELECT `rid`, `name`, `speed` FROM `interface` WHERE `id`=$interface";
-   &run_query($statement);
-   ($rid, $name, $speed) = @row;
- 
--  $statement="SELECT rid, name FROM router WHERE rid=$rid";
-+  $statement="SELECT `rid`, `name` FROM `router` WHERE `rid`=$rid";
-   &run_query($statement);
-   ($rid, $router) = @row;
- 
--  $statement="SELECT counter, UNIX_TIMESTAMP(dtime), dtime FROM ifInOctets_".$rid." WHERE $range AND id=$interface ORDER BY dtime"; 
-+  $statement="SELECT `counter`, UNIX_TIMESTAMP(`dtime`), `dtime` FROM `ifInOctets_".$rid."` WHERE $range AND `id`=$interface ORDER BY `dtime`"; 
-   ($intbytes_in, $maxin, $avgin) = &interface_stats($statement);
-   $bytesin = int($intbytes_in/1000000 + .5);
- 
--  $statement="SELECT counter, UNIX_TIMESTAMP(dtime), dtime FROM ifOutOctets_".$rid." WHERE $range AND id=$interface ORDER BY dtime"; 
-+  $statement="SELECT `counter`, UNIX_TIMESTAMP(`dtime`), `dtime` FROM `ifOutOctets_".$rid."` WHERE $range AND `id`=$interface ORDER BY `dtime`"; 
-   ($intbytes_out, $maxout, $avgout) = &interface_stats($statement);
-   $bytesout = int($intbytes_out/1000000 + .5);
- 
-@@ -267,6 +267,6 @@ $rc = $dbh->disconnect;
- exit;
- 
- format STDOUT = 
--@<<<<<<<<<<< @<<<<<<<<<<< @>>>>>>> @>>>>>>> @>>>>>> @>>>>>> @>>>>> @>>>>> @>>>>>> @>>>>>> @>>>>> @>>>>>
-+@<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<< @>>>>>>> @>>>>>>> @>>>>>> @>>>>>> @>>>>> @>>>>> @>>>>>> @>>>>>> @>>>>> @>>>>>
- $name,$router,&commify($bytesin), &commify($bytesout), $ratein, $rateout, $utilin, $utilout, $maxratein, $maxrateout, $maxutilin, $maxutilout  
- .

Modified: head/net/rtg/files/patch-etc_rtgtargmkr.pl.in
==============================================================================
--- head/net/rtg/files/patch-etc_rtgtargmkr.pl.in	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/files/patch-etc_rtgtargmkr.pl.in	Mon Feb  8 09:25:18 2021	(r564684)
@@ -1,110 +1,11 @@
---- etc/rtgtargmkr.pl.in.orig	2018-04-02 20:14:41 UTC
+--- etc/rtgtargmkr.pl.in.orig	2020-09-23 11:57:31 UTC
 +++ etc/rtgtargmkr.pl.in
-@@ -10,10 +10,11 @@
- # Local customization
- 
- $community   = "public";         # Default SNMP community
--$defbits     = 32;               # Default OID bits: 32/64
-+$defbits     = 64;               # Default OID bits: 32/64
- $output      = "targets.cfg";    # Output target file name
- $router_file = "routers";        # Input list of devices to poll
- $conf_file   = "rtg.conf";       # RTGpoll and RTGplot configurations
-+$update_desc = 0;		 # Update interface descriptions
- $INFO        = 1;                # Print informational messages
- $DEBUG       = 0;                # Print debug messages
- $DBOFF       = 0;                # Turn database queries off (debug)
-@@ -77,7 +78,7 @@ $catalyst = [
+@@ -78,7 +78,7 @@ $catalyst = [
  );
  
  # Default locations to find RTG configuration file
 - at configs = ("rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf");
-+ at configs = ("rtg.conf", "@RTG_HOME@/etc/rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf");
++ at configs = ("rtg.conf", "%%PREFIX%%/etc/rtg/rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf");
  foreach $conf (@configs) {
    if (open CONF, "<$conf") {
      print "Reading [$conf].\n" if $DEBUG;
-@@ -93,7 +94,9 @@ foreach $conf (@configs) {
-         $db_db=$cVals[1];
-       } elsif ($cVals[0] =~ /Interval/) {
-         $interval=$cVals[1];
--      }	
-+      }	elsif ($cVals[0] =~ /Update_desc/) {
-+        $update_desc=$cVals[1];
-+      }
-     }
-     last;
-   }
-@@ -113,7 +116,7 @@ sub sql_insert {
- # exist, create a new entry and corresponding tables.
- sub find_router_id {
-     ($router) = @_;
--    $sql = "SELECT DISTINCT rid FROM router WHERE name=\"$router\"";
-+    $sql = "SELECT DISTINCT `rid` FROM `router` WHERE `name`=\"$router\"";
-     print "SQL: $sql\n" if $DEBUG;
-     my $sth = $dbh->prepare($sql)
-       or die "Can't prepare $sql: $dbh->errstr\n";
-@@ -121,12 +124,12 @@ sub find_router_id {
-       or die "can't execute the query: $sth->errstr\n";
-     if ( $sth->rows == 0 ) {
-         print "No router id found for $router...";
--        $sql = "INSERT INTO router (name) VALUES(\"$router\")";
-+        $sql = "INSERT INTO `router` (`name`) VALUES(\"$router\")";
-         print "adding.\n";
-         &sql_insert($sql);
-         $rid = &find_router_id($router);
-         foreach $mib ( keys %mibs_of_interest ) {
--          $sql = "CREATE TABLE $mib"."_$rid (id INT NOT NULL, dtime DATETIME NOT NULL, counter BIGINT NOT NULL, KEY $mib"."_$rid". "_idx (dtime))";
-+          $sql = "CREATE TABLE `$mib"."_$rid` (`id` INT NOT NULL, `dtime` DATETIME NOT NULL, `counter` BIGINT NOT NULL, KEY `$mib"."_$rid". "_idx` (`dtime`), KEY `id_dtime_idx` (`id`,`dtime`))";
-           &sql_insert($sql);
-         }
-     }
-@@ -143,7 +146,7 @@ sub find_router_id {
- sub find_interface_id {
-     ( $rid, $int, $desc, $speed ) = @_;
-     $desc =~ s/ +$//g;    #remove trailing whitespace
--    $sql = "SELECT id, description FROM interface WHERE rid=$rid AND name=\"$int\"";
-+    $sql = "SELECT `id`, `description` FROM `interface` WHERE `rid`=$rid AND `name`=\"$int\"";
-     print "SQL: $sql\n" if $DEBUG;
-     my $sth = $dbh->prepare($sql)
-       or die "Can't prepare $sql: $dbh->errstr\n";
-@@ -152,7 +155,7 @@ sub find_interface_id {
-     if ( $sth->rows == 0 ) {
-         print "No id found for $int on device $rid...";
-         $desc =~ s/\"/\\\"/g;    # Fix " in desc
--        $sql = "INSERT INTO interface (name, rid, speed, description) VALUES(\"$int\", $rid, $speed, \"$desc\")";
-+        $sql = "INSERT INTO `interface` (`name`, `rid`, `speed`, `description`) VALUES(\"$int\", $rid, $speed, \"$desc\")";
-         print "adding.\n";
-         &sql_insert($sql);
-         $iid = &find_interface_id( $rid, $int, $desc, $speed );
-@@ -164,7 +167,13 @@ sub find_interface_id {
-             print "Interface description changed.\n";
-             print "Was: \"$row[1]\"\n";
-             print "Now: \"$desc\"\n";
--            print "Suggest: UPDATE interface SET description='$desc' WHERE id=$iid\n";
-+            if ( $update_desc == 1 ) {
-+              $sql = "UPDATE `interface` SET `description`='$desc' WHERE `id`=$iid";
-+              &sql_insert($sql);
-+              print "Updated.\n";
-+            } else {
-+              print "Suggest: UPDATE `interface` SET `description`='$desc' WHERE `id`=$iid\n";
-+            }
-         }
-     }
-     $sth->finish;
-@@ -289,7 +298,7 @@ sub main {
-       $year + 1900, $hour, $min;
-     print CFG "# Host\tOID\tBits\tCommunity\tTable\tID\tDescription\n";
- 
--    foreach $router (@routers) {
-+    POKE: foreach $router (@routers) {
-         $bits = $counterBits{$router};
-         # Sanity check bits
-         $bits = $defbits if ( ( $bits != 32 ) && ( $bits != 64 ) );
-@@ -304,7 +313,7 @@ sub main {
-         $system = join ( ' ', @result );
-         print "System: $system\n" if $DEBUG;
-         $session = SNMP_Session->open( $router, $communities{$router}, 161 )
--          || die "Error opening SNMP session to $router";
-+          || ( print "Error opening SNMP session to $router" and next POKE );
-         if ( $system =~ /.*Cisco.*WS-.*/ ) {
-             $system = "Catalyst";
-             $session->map_table( $catalyst, \&process );

Modified: head/net/rtg/files/rtgpoll.in
==============================================================================
--- head/net/rtg/files/rtgpoll.in	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/files/rtgpoll.in	Mon Feb  8 09:25:18 2021	(r564684)
@@ -21,10 +21,10 @@
 name="rtgpoll"
 rcvar=rtgpoll_enable
 
-cmd=%%PREFIX%%/bin/${name}
-command="/usr/sbin/daemon"
+start_precmd="${name}_prestart"
+command="%%PREFIX%%/bin/${name}"
 
-load_rc_config $name
+load_rc_config ${name}
 
 : ${rtgpoll_enable="NO"}
 : ${rtgpoll_config="%%PREFIX%%/etc/rtg/rtg.conf"}
@@ -33,19 +33,11 @@ load_rc_config $name
 : ${rtgpoll_user="rtg"}
 : ${rtgpoll_group="rtg"}
 
-required_files="$rtgpoll_targets"
+required_files="${rtgpoll_targets}"
+command_args="-b -p ${rtgpoll_pidfile} -c ${rtgpoll_config} -t ${rtgpoll_targets}"
 
-command_args="-f -p $rtgpoll_pidfile $cmd -c $rtgpoll_config -t $rtgpoll_targets"
-
-start_precmd="rtgpoll_prestart"
-
-rtgpoll_prestart() {
-  if [ ! -e "${rtgpoll_pidfile}" ]; then
-	touch $rtgpoll_pidfile
-  fi
-
-  chown "${rtgpoll_user}:${rtgpoll_group}" "$rtgpoll_pidfile"
-  chmod 640 "$rtgpoll_pidfile"
+rtgpoll_prestart()
+{
   chown -R "${rtgpoll_user}:${rtgpoll_group}" "%%PREFIX%%/etc/rtg"
   chmod -R u+rwX,g+rX "%%PREFIX%%/etc/rtg"
 }

Modified: head/net/rtg/pkg-plist
==============================================================================
--- head/net/rtg/pkg-plist	Mon Feb  8 09:07:40 2021	(r564683)
+++ head/net/rtg/pkg-plist	Mon Feb  8 09:25:18 2021	(r564684)
@@ -4,13 +4,13 @@ bin/rtgplot
 bin/rtgpoll
 contrib/README
 contrib/rtgtargmkr-with-modules-0.2.tar.gz
-%%ETCDIR%%/rtg.conf.sample
-%%ETCDIR%%/rtgtargmkr.pl
-%%ETCDIR%%/routers.sample
-%%ETCDIR%%/createdb
 %%ETCDIR%%/BER.pm
 %%ETCDIR%%/SNMP_Session.pm
 %%ETCDIR%%/SNMP_util.pm
+%%ETCDIR%%/createdb
+ at sample %%ETCDIR%%/routers.sample
+ at sample %%ETCDIR%%/rtg.conf.sample
+%%ETCDIR%%/rtgtargmkr.pl
 include/common.h
 include/rtg.h
 include/rtgplot.h


More information about the svn-ports-all mailing list