From owner-freebsd-questions@FreeBSD.ORG Tue Feb 21 15:25:17 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A87AA16A420 for ; Tue, 21 Feb 2006 15:25:17 +0000 (GMT) (envelope-from tundra@tundraware.com) Received: from eskimo.tundraware.com (eskimo.tundraware.com [64.2.229.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1873A43D45 for ; Tue, 21 Feb 2006 15:25:16 +0000 (GMT) (envelope-from tundra@tundraware.com) Received: from [192.168.0.2] (viper.tundraware.com [192.168.0.2]) (authenticated bits=0) by eskimo.tundraware.com (8.13.4/8.13.4) with ESMTP id k1LFPJjN029636 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Tue, 21 Feb 2006 09:25:19 -0600 (CST) (envelope-from tundra@tundraware.com) Message-ID: <43FB30D7.5080509@tundraware.com> Date: Tue, 21 Feb 2006 09:25:11 -0600 From: Tim Daneliuk Organization: TundraWare Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Warren Block References: <43F8E25D.5030503@tundraware.com> <20060219164805.0de1772d.bsd-unix@comcast.net> <43F9EC82.80609@tundraware.com> <20060220194218.27f2f710.bsd-unix@comcast.net> <43FA88EB.9020103@tundraware.com> <20060221074639.H49013@wonkity.com> In-Reply-To: <20060221074639.H49013@wonkity.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner: Found to be clean X-MailScanner-From: tundra@tundraware.com Cc: freebsd-questions@freebsd.org Subject: Re: Path And 'cron' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tundra@tundraware.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2006 15:25:17 -0000 Warren Block wrote: > On Mon, 20 Feb 2006, Tim Daneliuk wrote: > >> In case you're interested (or anyone else listening), it seems that >> 'chown' likes to live in /usr/sbin - i.e., A place not in the default >> path. As it happens, a root cron task is trying to run a script >> that uses 'chown' and is thus failing. I can change the PATH just >> for root's crontab and solve the problem. I was just curious if there >> was a way to more broadly modify the defaults used by cron. > > > The standard solution would be to use a full path to the command in the > script (/usr/sbin/chown). If it's used in multiple locations, defining > it as a shell variable makes it maintainable: > > CHOWN="/usr/sbin/chown" > > ${CHOWN} somefile > ... > ${CHOWN} anotherfile > > -Warren Block * Rapid City, South Dakota USA The problem in this case is that it is not a shell script I own or maintain - it is the shell script provided with 'nessus' to update its plugins. I could certainly modify the script, but then I'd have to remember to do this every time I upgraded the program. I prefer "fire and forget" solutions that take care of themselves automatically. Hence my desire to be able to change the default path cron uses in some config file.... -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/