From owner-freebsd-questions@FreeBSD.ORG Mon Jan 19 06:02:02 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF1DC106566B for ; Mon, 19 Jan 2009 06:02:01 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id 8904A8FC0C for ; Mon, 19 Jan 2009 06:02:01 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1LOnCv-0006WR-17; Mon, 19 Jan 2009 06:01:57 +0000 Received: from melon.esperance-linux.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.14.1/8.14.1/Debian-9) with ESMTP id n0J61uIF015280; Mon, 19 Jan 2009 06:01:56 GMT Received: by melon.esperance-linux.co.uk (Postfix, from userid 1001) id 35182FCA4DC; Mon, 19 Jan 2009 06:01:51 +0000 (GMT) Date: Mon, 19 Jan 2009 06:01:51 +0000 From: Frank Shute To: Andy Smith Message-ID: <20090119060151.GA47488@melon.esperance-linux.co.uk> Mail-Followup-To: Andy Smith , freebsd-questions@freebsd.org References: <20090118154724.780736hzlg7x77k0@horde.ukgrid.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090118154724.780736hzlg7x77k0@horde.ukgrid.net> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 6.4-RELEASE-p2 i386 X-Organisation: 'http://www.shute.org.uk/' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.1.7 (zetnet.co.uk [194.247.46.1]); Mon, 19 Jan 2009 06:01:56 +0000 (GMT) Cc: freebsd-questions@freebsd.org Subject: Re: PATH used by www user X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 06:02:03 -0000 On Sun, Jan 18, 2009 at 03:47:24PM +0000, Andy Smith wrote: > > Hi, > > I'm trying to work out why the PATH is different for the www user > on two different FreeBSD servers. The problem being that on one it > cant find the traceroute binary (via a perl script hosted on apache > 2.2). The www user on both is the FreeBSD default, so has no home > directory on either. The /etc/profile is the same on both servers, > also the login.conf have the same path value set and there are no > /etc/bash files. But still on one server the path is > /sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin > and on the other only /bin:/usr/bin. > > Can someone tell me where the path may be being set that I havent looked? > User www doesn't have a shell, profile & hence PATH. I don't know how your path is being set but it depends on perl & how your script looks. Look at Env(3) & the other perldocs. If you want to do it quick, call traceroute with the path in your scripts e.g: system "/usr/sbin/traceroute $some_host"; There's probably a perl module with a "traceroute" in it but I'm afraid I don't know it offhand. Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html