From nobody@FreeBSD.org  Wed Oct 27 06:18:43 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41768106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Oct 2010 06:18:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 305C88FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Oct 2010 06:18:43 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9R6IgjW007007
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Oct 2010 06:18:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9R6IgSL007006;
	Wed, 27 Oct 2010 06:18:42 GMT
	(envelope-from nobody)
Message-Id: <201010270618.o9R6IgSL007006@www.freebsd.org>
Date: Wed, 27 Oct 2010 06:18:42 GMT
From: Boris Kovalenko <boris@tagnet.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: spine 0.8.7g hangs up after one host poll
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151770
>Category:       ports
>Synopsis:       net-mgmt/cacti-spine: spine 0.8.7g hangs up after one host poll
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    skreuzer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 27 06:20:04 UTC 2010
>Closed-Date:    Thu Nov 04 22:25:26 UTC 2010
>Last-Modified:  Thu Nov  4 22:30:09 UTC 2010
>Originator:     Boris Kovalenko
>Release:        7.2-R amd64
>Organization:
JSC "TAGNet"
>Environment:
FreeBSD oms.tagnet.ru 7.2-RELEASE FreeBSD 7.2-RELEASE #2: Mon Sep 28 15:53:50 YEKST 2009     root@jails.tagnet.ru:/usr/obj/usr/src/sys/JAILS  amd64
>Description:
Spine hangs up after host poll (see debug output). IMHO the problem is in poller.c line 68: thread_mutex_lock(LOCK_THREAD)

[root@oms ~]# spine -H 0 -V 5]
SPINE: Using spine config file [/usr/local/etc/spine.conf]
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The path_php_server variable is /usr/local/share/cacti/script_server.php
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The path_cactilog variable is /usr/local/share/cacti/log/cacti.log
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The log_destination variable is 1 (FILE)
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The path_php variable is /usr/local/bin/php
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The availability_method variable is 2
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The ping_recovery_count variable is 3
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The ping_failure_count variable is 2
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The ping_method variable is 2
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The ping_retries variable is 1
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The ping_timeout variable is 400
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The snmp_retries variable is 3
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The log_perror variable is 1
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The log_pwarn variable is 0
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The boost_redirect variable is 0
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The log_pstats variable is 0
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The threads variable is 8
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The polling interval is 300 seconds
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The number of concurrent processes is 1
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The script timeout is 60
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The number of php script servers to run is 4
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: Host List to be polled='0', TotalPHPScripts='0'
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The PHP Script Server is Not Required
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The Maximum SNMP OID Get Size is 10
10/27/2010 12:15:49 PM - SPINE: Poller[0] Version 0.8.7g starting
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: MySQL is Thread Safe!
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: Spine is running asroot.
10/27/2010 12:15:49 PM - SPINE: Poller[0] SPINE: Initializing Net-SNMP API
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: Issues with SNMP Header Version information, assuming old version of Net-SNMP.
10/27/2010 12:15:49 PM - SPINE: Poller[0] SPINE: Initializing PHP Script Server(s)
10/27/2010 12:15:49 PM - SPINE: Poller[0] NOTE: Spine did not detect multithreaded device polling.
10/27/2010 12:15:49 PM - SPINE: Poller[0] NOTE: Spine is behaving in a 0.8.7g manner
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: Initial Value of Active Threads is 0
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: Valid Thread to be Created
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: In Poller, About to Start Polling of Host
10/27/2010 12:15:49 PM - SPINE: Poller[0] DEBUG: The Value of Active Threads is 1
10/27/2010 12:15:49 PM - SPINE: Poller[0] Host[0] TH[1] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function

>How-To-Repeat:
Install and run cacti-spine 0.8.7g on FreeBSD 7.2R-amd64 jailed enviroment
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->skreuzer 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Oct 28 22:51:28 UTC 2010 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151770 

From: Panagiotis Christias <p.christias@noc.ntua.gr>
To: bug-followup@FreeBSD.org, boris@tagnet.ru
Cc:  
Subject: Re: ports/151770: net-mgmt/cacti-spine: spine 0.8.7g hangs up after
 one host poll
Date: Mon, 01 Nov 2010 17:38:52 +0200

 This is a multi-part message in MIME format.
 --------------070703010902090601000400
 Content-Type: text/plain; charset=ISO-8859-7; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Patch is available as "Unified Patch 2010/08/31" at:
 
    http://www.cacti.net/spine_download_patches.php
 
 Tested and prepared new version for net-mgmt/cacti-spine (see attached 
 shar file).
 
 -- 
 Panagiotis J. Christias    Network Management Center
 p.christias@noc.ntua.gr    National Technical Univ. of Athens, GREECE
 
 --------------070703010902090601000400
 Content-Type: text/plain;
  name="cacti-spine.shar.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="cacti-spine.shar.txt"
 
 # 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:
 #
 #	cacti-spine
 #	cacti-spine/files
 #	cacti-spine/files/patch-util.h
 #	cacti-spine/files/patch-util.c
 #	cacti-spine/files/patch-spine.h
 #	cacti-spine/files/patch-spine.c
 #	cacti-spine/files/patch-snmp.c
 #	cacti-spine/files/patch-poller.c
 #	cacti-spine/Makefile
 #	cacti-spine/distinfo
 #	cacti-spine/pkg-descr
 #	cacti-spine/pkg-plist
 #
 echo c - cacti-spine
 mkdir -p cacti-spine > /dev/null 2>&1
 echo c - cacti-spine/files
 mkdir -p cacti-spine/files > /dev/null 2>&1
 echo x - cacti-spine/files/patch-util.h
 sed 's/^X//' >cacti-spine/files/patch-util.h << 'a49a9d4a89a199fb11b6a5dfee28814f'
 X--- util.h.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ util.h	2010-11-01 14:33:54.000000000 +0200
 X@@ -54,7 +54,7 @@
 X extern int is_hexadecimal(const char * str, const short ignore_space);
 X 
 X /* string and file functions */
 X-extern char *add_slashes(char *string, int arguments_2_strip);
 X+extern char *add_slashes(char *string);
 X extern int file_exists(const char *filename);
 X extern char *strip_alpha(char *string);
 X extern char *strncopy(char *dst, const char *src, size_t n);
 a49a9d4a89a199fb11b6a5dfee28814f
 echo x - cacti-spine/files/patch-util.c
 sed 's/^X//' >cacti-spine/files/patch-util.c << '300fbb056982f6e970b311a99a964a8d'
 X--- util.c.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ util.c	2010-11-01 14:33:54.000000000 +0200
 X@@ -755,7 +755,7 @@
 X 	/* empty string is not all digits */
 X 	if ( *string == '\0' ) return FALSE;
 X 
 X-	while ( isdigit(*string) )
 X+	while ( isdigit((int)*string) )
 X 		string++;
 X 
 X 	return *string == '\0';
 X@@ -773,7 +773,7 @@
 X  */
 X int is_ipaddress(const char *string) {
 X 	while (*string) {
 X-		if ((isdigit(*string)) ||
 X+		if ((isdigit((int)*string)) ||
 X 			(*string == '.') ||
 X 			(*string == ':')) {
 X 			string++;
 X@@ -887,7 +887,7 @@
 X 	i = strlen(string);
 X 
 X 	while (i >= 0) {
 X-		if (isdigit(string[i])) {
 X+		if (isdigit((int)string[i])) {
 X 			break;
 X 		}else{
 X 			string[i] = '\0';
 X@@ -898,17 +898,15 @@
 X 	return string;
 X }
 X 
 X-/*! \fn char *add_slashes(char *string, int arguments_2_strip)
 X- *  \brief change all backslashes to forward slashes for the first n arguements.
 X+/*! \fn char *add_slashes(char *string)
 X+ *  \brief add escaping to back slashes on for Windows type commands.
 X  *  \param string the string to replace slashes
 X- *  \param arguments_2_strip the number of space delimited arguments to reverse
 X  *
 X  *  \return a pointer to the modified string. Variable must be freed by parent.
 X  *
 X  */
 X-char *add_slashes(char *string, int arguments_2_strip) {
 X+char *add_slashes(char *string) {
 X 	int length;
 X-	int space_count;
 X 	int position;
 X 	int new_position;
 X 	char *return_str;
 X@@ -919,9 +917,8 @@
 X 	return_str[0] = '\0';
 X 
 X 	length = strlen(string);
 X-	space_count = 0;
 X 	position = 0;
 X-	new_position = position;
 X+	new_position = 0;
 X 
 X 	/* simply return on blank string */
 X 	if (!length) {
 X@@ -931,17 +928,9 @@
 X 	while (position < length) {
 X 		/* backslash detected, change to forward slash */
 X 		if (string[position] == '\\') {
 X-			/* only add slashes for first x arguments */
 X-			if (space_count < arguments_2_strip) {
 X-				return_str[new_position] = '/';
 X-			}else{
 X-				return_str[new_position] = string[position];
 X-			}
 X-		/* end of argument detected */
 X-		}else if (string[position] == ' ') {
 X-			return_str[new_position] = ' ';
 X-			space_count++;
 X-		/* normal character detected */
 X+			return_str[new_position] = '\\';
 X+			new_position++;
 X+			return_str[new_position] = '\\';
 X 		}else{
 X 			return_str[new_position] = string[position];
 X 		}
 X@@ -1248,7 +1237,7 @@
 X 	seteuid(0);
 X 
 X 	if (geteuid() != 0) {
 X-		SPINE_LOG_DEBUG(("WARNING: Spine NOT running asroot.  This is require if using ICMP.  Please run \"chmod +s;chown root:root spine\" to resolve."));
 X+		SPINE_LOG_DEBUG(("WARNING: Spine NOT running asroot.  This is required if using ICMP.  Please run \"chmod +s;chown root:root spine\" to resolve."));
 X 		set.icmp_avail = FALSE;
 X 	}else{
 X 		SPINE_LOG_DEBUG(("DEBUG: Spine is running asroot."));
 300fbb056982f6e970b311a99a964a8d
 echo x - cacti-spine/files/patch-spine.h
 sed 's/^X//' >cacti-spine/files/patch-spine.h << 'a84af9e4c385fe102cdc156a730d7f99'
 X--- spine.h.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ spine.h	2010-11-01 14:33:54.000000000 +0200
 X@@ -504,5 +504,6 @@
 X extern char   start_datetime[20];
 X extern char   config_paths[CONFIG_PATHS][BUFSIZE];
 X extern int    active_threads;
 X+extern int    thread_ready;
 X 
 X #endif /* not _SPINE_H_ */
 a84af9e4c385fe102cdc156a730d7f99
 echo x - cacti-spine/files/patch-spine.c
 sed 's/^X//' >cacti-spine/files/patch-spine.c << '8e92df7f682405510537bfa6a51a11c7'
 X--- spine.c.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ spine.c	2010-11-01 14:33:54.000000000 +0200
 X@@ -94,6 +94,7 @@
 X int num_hosts = 0;
 X int active_threads = 0;
 X int active_scripts = 0;
 X+int thread_ready   = FALSE;
 X 
 X config_t set;
 X php_t	*php_processes = 0;
 X@@ -134,7 +135,7 @@
 X 	int poller_counter = 0;
 X 	int last_active_threads = 0;
 X 	int valid_conf_file = FALSE;
 X-	long int EXTERNAL_THREAD_SLEEP = 5000;
 X+	long int EXTERNAL_THREAD_SLEEP = 50;
 X 	long int internal_thread_sleep;
 X 	char querybuf[BIG_BUFSIZE], *qp = querybuf;
 X 	char *host_time = NULL;
 X@@ -196,6 +197,7 @@
 X 
 X 	/* we attempt to support scripts better in cygwin */
 X 	#if defined(__CYGWIN__)
 X+	setenv("CYGWIN", "nodosfilewarning", 1);
 X 	if (file_exists("./sh.exe")) {
 X 		set.cygwinshloc = 0;
 X 		printf("NOTE: The Shell Command Exists in the current directory\n");
 X@@ -281,7 +283,7 @@
 X 
 X 		else if (STRMATCH(arg, "-H") ||
 X 				 STRIMATCH(arg, "--hostlist")) {
 X-			snprintf(set.host_id_list, BIG_BUFSIZE, getarg(opt, &argv));
 X+			snprintf(set.host_id_list, BIG_BUFSIZE, "%s", getarg(opt, &argv));
 X 		}
 X 
 X 		else if (STRMATCH(arg, "-h") ||
 X@@ -584,6 +586,11 @@
 X 				poller_details->host_data_ids    = itemsPT;
 X 				poller_details->host_time        = host_time;
 X 
 X+				/* this variable tells us that the child had loaded the poller
 X+				 * poller_details structure and we can move on to the next thread
 X+				 */
 X+				thread_ready = FALSE;
 X+
 X 				/* create child process */
 X 				thread_status = pthread_create(&threads[device_counter], &attr, child, poller_details);
 X 
 X@@ -596,6 +603,11 @@
 X 						}
 X 						active_threads++;
 X 
 X+						/* wait for the child to read and process the structure */
 X+						while (!thread_ready) { 
 X+							usleep(internal_thread_sleep);
 X+						}
 X+
 X 						SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i", active_threads));
 X 
 X 						break;
 X@@ -603,7 +615,7 @@
 X 						SPINE_LOG(("ERROR: The System Lacked the Resources to Create a Thread"));
 X 						break;
 X 					case EFAULT:
 X-						SPINE_LOG(("ERROR: The Thread or Attribute Was Invalid"));
 X+						SPINE_LOG(("ERROR: The Thread or Attribute were Invalid"));
 X 						break;
 X 					case EINVAL:
 X 						SPINE_LOG(("ERROR: The Thread Attribute is Not Initialized"));
 X@@ -613,6 +625,8 @@
 X 						break;
 X 				}
 X 
 X+				thread_mutex_unlock(LOCK_THREAD);
 X+
 X 				/* get current time and exit program if time limit exceeded */
 X 				if (poller_counter >= 20) {
 X 					current_time = get_time_as_double();
 8e92df7f682405510537bfa6a51a11c7
 echo x - cacti-spine/files/patch-snmp.c
 sed 's/^X//' >cacti-spine/files/patch-snmp.c << '74aee9908690225ea7f55abba69d7c23'
 X--- snmp.c.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ snmp.c	2010-11-01 14:33:54.000000000 +0200
 X@@ -499,13 +499,9 @@
 X 	size_t out_len = 0;
 X 
 X 	if ((buf = (u_char *) calloc(buf_len, 1)) != 0) {
 X-		if (sprint_realloc_value(&buf, &buf_len, &out_len, 1,
 X-				objid, objidlen, variable)) {
 X+		sprint_realloc_by_type(&buf, &buf_len, &out_len, 1, variable, NULL, NULL, NULL);
 X 			snprintf(obuf, buf_len, "%s", buf);
 X 		}else{
 X-			snprintf(obuf, buf_len, "%s [TRUNCATED]", buf);
 X-		}
 X-	}else{
 X 		SET_UNDEFINED(obuf);
 X 	}
 X 
 X@@ -528,6 +524,7 @@
 X 	int i;
 X 	int array_count;
 X 	int index_count;
 X+	char   temp_result[RESULTS_BUFFER];
 X 
 X 	struct nameStruct {
 X 	    oid             name[MAX_OID_LEN];
 X@@ -570,11 +567,13 @@
 X 				for(i = 0; i < num_oids && vars; i++) {
 X 					if (!IS_UNDEFINED(snmp_oids[i].result)) {
 X 						#ifdef USE_NET_SNMP
 X-						snmp_snprint_value(snmp_oids[i].result, RESULTS_BUFFER, vars->name, vars->name_length, vars);
 X+						snmp_snprint_value(temp_result, RESULTS_BUFFER, vars->name, vars->name_length, vars);
 X 						#else
 X-						sprint_value(snmp_oids[i].result, vars->name, vars->name_length, vars);
 X+						sprint_value(temp_result, vars->name, vars->name_length, vars);
 X 						#endif
 X 						
 X+						snprintf(snmp_oids[i].result, RESULTS_BUFFER, "%s", trim(temp_result));
 X+						
 X 						vars = vars->next_variable;
 X 					}
 X 				}
 74aee9908690225ea7f55abba69d7c23
 echo x - cacti-spine/files/patch-poller.c
 sed 's/^X//' >cacti-spine/files/patch-poller.c << '74c79e20a6b0f2992cedea40f6b3fd35'
 X--- poller.c.orig	2010-07-10 00:39:53.000000000 +0300
 X+++ poller.c	2010-11-01 14:33:54.000000000 +0200
 X@@ -57,21 +57,26 @@
 X 	host_data_ids    = poller_details.host_data_ids;
 X 	snprintf(host_time, SMALL_BUFSIZE, "%s", poller_details.host_time);
 X 
 X-	thread_mutex_unlock(LOCK_THREAD);
 X-
 X 	free(arg);
 X 
 X+	thread_ready = TRUE;
 X+
 X 	SPINE_LOG_DEBUG(("DEBUG: In Poller, About to Start Polling of Host"));
 X 
 X 	poll_host(host_id, host_thread, last_host_thread, host_data_ids, host_time);
 X 
 X-	thread_mutex_lock(LOCK_THREAD);
 X-
 X+	while (TRUE) {
 X+		if (thread_mutex_trylock(LOCK_THREAD) == 0) {
 X 	active_threads--;
 X+			thread_mutex_unlock(LOCK_THREAD);
 X 
 X-	SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i" ,active_threads));
 X+			break;
 X+		}
 X 
 X-	thread_mutex_unlock(LOCK_THREAD);
 X+		usleep(100);
 X+	}
 X+
 X+	SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i" ,active_threads));
 X 
 X 	/* end the thread */
 X 	pthread_exit(0);
 X@@ -965,7 +970,7 @@
 X 				poll_result = exec_poll(host, poller_items[i].arg1);
 X 
 X 				/* process the result */
 X-				if ((is_numeric(poll_result)) || (is_multipart_output(poll_result))) {
 X+				if ((is_numeric(poll_result)) || (is_multipart_output(trim(poll_result)))) {
 X 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%s", poll_result);
 X 				}else if (is_hexadecimal(snmp_oids[j].result, TRUE)) {
 X 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%lld", hex2dec(poll_result));
 X@@ -998,7 +1003,7 @@
 X 				poll_result = php_cmd(poller_items[i].arg1, php_process);
 X 
 X 				/* process the output */
 X-				if ((is_numeric(poll_result)) || (is_multipart_output(poll_result))) {
 X+				if ((is_numeric(poll_result)) || (is_multipart_output(trim(poll_result)))) {
 X 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%s", poll_result);
 X 				}else if (is_hexadecimal(snmp_oids[j].result, TRUE)) {
 X 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%lld", hex2dec(poll_result));
 X@@ -1247,7 +1252,7 @@
 X 		if (is_numeric(result)) {
 X 			return TRUE;
 X 		}else{
 X-			if (is_multipart_output(result)) {
 X+			if (is_multipart_output(trim(result))) {
 X 				return TRUE;
 X 			}else{
 X 				return FALSE;
 X@@ -1290,7 +1295,7 @@
 X 
 X 	/* compensate for back slashes in arguments */
 X 	#if defined(__CYGWIN__)
 X-	proc_command = add_slashes(command, 2);
 X+	proc_command = add_slashes(command);
 X 	#else
 X 	proc_command = command;
 X 	#endif
 X@@ -1340,7 +1345,7 @@
 X 		FD_SET(cmd_fd, &fds);
 X 
 X 		/* wait x seonds for pipe response */
 X-		switch (select(cmd_fd+1, &fds, NULL, NULL, &timeout)) {
 X+		switch (select(FD_SETSIZE, &fds, NULL, NULL, &timeout)) {
 X 		case -1:
 X 			switch (errno) {
 X 			case EBADF:
 X@@ -1381,11 +1386,13 @@
 X 				break;
 X 			}
 X 		case 0:
 X+			#ifdef USING_TPOPEN
 X 			SPINE_LOG(("Host[%i] ERROR: The POPEN timed out", current_host->id));
 X 
 X-			#ifdef USING_TPOPEN
 X 			close_fd = FALSE;
 X 			#else
 X+			SPINE_LOG(("Host[%i] ERROR: The NIFTY POPEN timed out", current_host->id));
 X+
 X 			pid = nft_pchild(cmd_fd);
 X 			kill(pid, SIGKILL);
 X 			#endif
 74c79e20a6b0f2992cedea40f6b3fd35
 echo x - cacti-spine/Makefile
 sed 's/^X//' >cacti-spine/Makefile << 'b4aa05b86e19b5ad651aa5d8159c5315'
 X# New ports collection makefile for:   cactid
 X# Date created:        Feb 26 2005
 X# Whom:                clement@FreeBSD.org
 X#
 X# $FreeBSD: ports/net-mgmt/cacti-spine/Makefile,v 1.24 2010/10/12 23:08:33 pav Exp $
 X#
 X
 XPORTNAME=	spine
 XPORTVERSION=	0.8.7.g
 XPORTREVISION=	1
 XCATEGORIES=	net-mgmt
 XMASTER_SITES=	http://www.cacti.net/downloads/${PORTNAME}/
 XDISTNAME=	cacti-${PORTNAME}-0.8.7g
 X
 XMAINTAINER=	skreuzer@FreeBSD.org
 XCOMMENT=	A multithreaded poller for Cacti written in C
 X
 XLIB_DEPENDS=	netsnmp.20:${PORTSDIR}/net-mgmt/net-snmp
 X
 XGNU_CONFIGURE=	YES
 XCONFIGURE_ARGS+=--with-mysql=${LOCALBASE} --with-snmp=${LOCALBASE}
 XCONFIGURE_ENV=	LDFLAGS="`net-snmp-config --libs`" \
 X		CPPFLAGS="`net-snmp-config --cflags`"
 XUSE_MYSQL=	YES
 XUSE_OPENSSL=	YES
 XUSE_AUTOTOOLS=	libtool:22
 X
 Xpost-patch:
 X	@${REINPLACE_CMD} 's,#define\ *DEFAULT_CONF_FILE .*,#define DEFAULT_CONF_FILE "${PREFIX}/etc/spine.conf",' ${WRKSRC}/spine.h
 X
 Xpre-configure:
 X	@(cd ${WRKSRC} ; ${LIBTOOLIZE} --copy --force --install)
 X
 Xdo-install:
 X	@${INSTALL_PROGRAM} ${WRKSRC}/spine ${PREFIX}/bin
 X	@${MKDIR} ${EXAMPLESDIR}
 X	@${INSTALL_DATA} ${WRKSRC}/spine.conf.dist ${EXAMPLESDIR}/spine.conf
 X	@[ -e ${PREFIX}/etc/spine.conf ] || \
 X		${INSTALL_DATA} ${EXAMPLESDIR}/spine.conf ${PREFIX}/etc/spine.conf
 X
 X.include <bsd.port.mk>
 b4aa05b86e19b5ad651aa5d8159c5315
 echo x - cacti-spine/distinfo
 sed 's/^X//' >cacti-spine/distinfo << 'b1a552b7c3b03a006c0f5b8af2869ee5'
 XMD5 (cacti-spine-0.8.7g.tar.gz) = 22c2b1986c880b9c587876c18d5c3f9f
 XSHA256 (cacti-spine-0.8.7g.tar.gz) = 2735fbc1fc38d31651009d0a8d6ea121b29403d6020b13ba245ab4f3e0f6d561
 XSIZE (cacti-spine-0.8.7g.tar.gz) = 592801
 b1a552b7c3b03a006c0f5b8af2869ee5
 echo x - cacti-spine/pkg-descr
 sed 's/^X//' >cacti-spine/pkg-descr << '9d1ac1bd413d14d2c1948a7acc4a7d9c'
 XCactid is a poller for Cacti that primarily strives to be as fast as 
 Xpossible. For this reason it is written in native C, makes use of POSIX 
 Xthreads, and is linked directly against the net-snmp library for 
 Xminmumal SNMP polling overhead. Cactid is a replacement for the default 
 Xcmd.php poller so you must decide if using Cactid makes sense for your 
 Xinstallation.
 X
 XWWW: http://www.cacti.net/cactid_info.php
 9d1ac1bd413d14d2c1948a7acc4a7d9c
 echo x - cacti-spine/pkg-plist
 sed 's/^X//' >cacti-spine/pkg-plist << 'd9d582e6521974617b5c5dff878709b7'
 Xbin/spine
 X@unexec if cmp -s %D/etc/spine.conf %D/%%EXAMPLESDIR%%/spine.conf; then rm -f %D/etc/spine.conf; fi
 X%%EXAMPLESDIR%%/spine.conf
 X@exec [ -f %D/etc/spine.conf ] || cp %D/%%EXAMPLESDIR%%/spine.conf %D/etc/spine.conf
 X@dirrm %%EXAMPLESDIR%%
 d9d582e6521974617b5c5dff878709b7
 exit
 
 
 --------------070703010902090601000400--

From: Olli Hauer <ohauer@FreeBSD.org>
To: <bug-followup@FreeBSD.org>
Cc: <skreuzer@FreeBSD.org>
Subject: Re: ports/151770: net-mgmt/cacti-spine: spine 0.8.7g hangs up after one host poll
Date: Tue,  2 Nov 2010 00:13:18 +0100 (CET)

 I also run into the same issue on my prod machine
 and the Vendor patch solved this.
 
 patch change.log:
 ======================
 Patched 0.8.7g
 -bug#0001669: Problems with getting data from script using SPINE on Windows Server 2003 x32
 -bug#0001829: Wrong string numerical value got from Spine SNMP poller
 -bug: Net-snmp API issues cause spine crashes with some SNMP agents
 -bug: Host list not properly initialized
 -bug: Mutex locking issues cause deadlocks in Windows
 -bug: Escape windows type back slashes in scripts
 
 
 The following diff is a little smaller and clearer.
 
 --- patch_cacti-spine.txt begins here ---
 Index: Makefile
 ===================================================================
 RCS file: /home/pcvs/ports/net-mgmt/cacti-spine/Makefile,v
 retrieving revision 1.24
 diff -u -r1.24 Makefile
 --- Makefile	12 Oct 2010 23:08:33 -0000	1.24
 +++ Makefile	1 Nov 2010 22:00:25 -0000
 @@ -7,10 +7,16 @@
  
  PORTNAME=	spine
  PORTVERSION=	0.8.7.g
 +PORTREVISION=	1
  CATEGORIES=	net-mgmt
  MASTER_SITES=	http://www.cacti.net/downloads/${PORTNAME}/
  DISTNAME=	cacti-${PORTNAME}-0.8.7g
  
 +# Vendor's patches
 +PATCH_SITES=	http://www.cacti.net/downloads/spine/patches/0.8.7g/
 +PATCHFILES= 	unified_issues.patch
 +PATCH_DIST_STRIP=-p1
 +
  MAINTAINER=	skreuzer@FreeBSD.org
  COMMENT=	A multithreaded poller for Cacti written in C
  
 Index: distinfo
 ===================================================================
 RCS file: /home/pcvs/ports/net-mgmt/cacti-spine/distinfo,v
 retrieving revision 1.9
 diff -u -r1.9 distinfo
 --- distinfo	11 Oct 2010 16:17:53 -0000	1.9
 +++ distinfo	1 Nov 2010 22:00:25 -0000
 @@ -1,3 +1,4 @@
 -MD5 (cacti-spine-0.8.7g.tar.gz) = 22c2b1986c880b9c587876c18d5c3f9f
  SHA256 (cacti-spine-0.8.7g.tar.gz) = 2735fbc1fc38d31651009d0a8d6ea121b29403d6020b13ba245ab4f3e0f6d561
  SIZE (cacti-spine-0.8.7g.tar.gz) = 592801
 +SHA256 (unified_issues.patch) = 5bfc4fe3eeedbab4d32620b6e141b0b6cfe674e76a938c19e13fb1b70e80fa0b
 +SIZE (unified_issues.patch) = 11583
 --- patch_cacti-spine.txt ends here ---
State-Changed-From-To: open->closed 
State-Changed-By: skreuzer 
State-Changed-When: Thu Nov 4 22:25:24 UTC 2010 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151770 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/151770: commit references a PR
Date: Thu,  4 Nov 2010 22:25:12 +0000 (UTC)

 skreuzer    2010-11-04 22:25:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/cacti-spine Makefile distinfo 
   Log:
   Apply "Unified Patch 2010/08/31" from vendor
   
   PR:             ports/151770
   Submitted by:   Olli Hauer <ohauer@FreeBSD.org>
   
   Revision  Changes    Path
   1.25      +6 -0      ports/net-mgmt/cacti-spine/Makefile
   1.10      +2 -1      ports/net-mgmt/cacti-spine/distinfo
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
