Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Aug 2005 12:11:17 +0200 (CEST)
From:      Lupe Christoph <lupe@lupe-christoph.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/84904: p5-Net-Server path for restart is mangled
Message-ID:  <20050814101117.64574A8D1@firewally.lupe-christoph.de>
Resent-Message-ID: <200508141020.j7EAK9IL026135@freefall.freebsd.org>

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

>Number:         84904
>Category:       ports
>Synopsis:       p5-Net-Server path for restart is mangled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 14 10:20:09 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Lupe Christoph
>Release:        FreeBSD 4.10-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD firewally.lupe-christoph.de 4.10-RELEASE-p5 FreeBSD 4.10-RELEASE-p5 #2: Sat Dec 11 17:38:51 CET 2004 lupe@firewally.lupe-christoph.de:/usr/obj/usr/src/sys/FIREWALLY i386


	
>Description:
	This bug prevents munin-node from restarting:

	2005/08/14-11:11:10 HUP'ing server
	Can't exec "/home/lupe//usr/local/sbin/munin-node": No such file or directory at /usr/local/lib/perl5/site_perl/5.005/Net/Server.pm line 1016.

	It affects everything written with Net::Server that is
	restarted with a HUP signal. Even scripts that start with
	a relative path are affected because the path becomes
	absolute after the first restart. cd'ing to / does not help
	in the long run because the path grows by two slashes on
	every HUP. The only cure is unsetting the PWD environment
	variable.

	I have already filed a bug on rt.cpan.org
	https://rt.cpan.org/Ticket/Display.html?id=14155

>How-To-Repeat:
	Install the munin-node port.
	Add munin_node_enable="YES" to /etc/rc.conf.
	/usr/local/etc/rc.d/munin-node.sh start
	ps xa | awk '/munin-node/ { print "kill -HUP " $1 }' | sh -x
	tail /var/log/munin-node.log
>Fix:

	

--- Net::Server.patch begins here ---
--- /usr/local/lib/perl5/site_perl/5.005/Net/Server.pm.orig	Tue Jun 21 23:16:03 2005
+++ /usr/local/lib/perl5/site_perl/5.005/Net/Server.pm	Sun Aug 14 12:06:55 2005
@@ -49,7 +49,7 @@
 
   ### save for a HUP
   my $script = $0;
-  $script = $ENV{'PWD'} .'/'. $0 if $ENV{'PWD'};
+  $script = $ENV{'PWD'} .'/'. $0 if exists $ENV{'PWD'} and $script !~ m(^/);
   $self->{server}->{commandline} = [ $script, @ARGV ]
     unless defined $self->{server}->{commandline};
 
--- Net::Server.patch ends here ---


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



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