From owner-freebsd-questions@FreeBSD.ORG Tue Feb 21 00:41:57 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 3907716A444 for ; Tue, 21 Feb 2006 00:41:57 +0000 (GMT) (envelope-from bsd-unix@comcast.net) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [63.240.77.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD48943D46 for ; Tue, 21 Feb 2006 00:41:56 +0000 (GMT) (envelope-from bsd-unix@comcast.net) Received: from kt.weeble.com (c-68-56-224-228.hsd1.fl.comcast.net[68.56.224.228]) by comcast.net (sccrmhc13) with SMTP id <200602210041530130021e50e>; Tue, 21 Feb 2006 00:41:53 +0000 Date: Mon, 20 Feb 2006 19:42:18 -0500 From: Randy Pratt To: tundra@tundraware.com Message-Id: <20060220194218.27f2f710.bsd-unix@comcast.net> In-Reply-To: <43F9EC82.80609@tundraware.com> References: <43F8E25D.5030503@tundraware.com> <20060219164805.0de1772d.bsd-unix@comcast.net> <43F9EC82.80609@tundraware.com> X-Mailer: Sylpheed version 2.2.0 (GTK+ 2.8.12; i386-portbld-freebsd6.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Path And 'cron' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2006 00:41:57 -0000 On Mon, 20 Feb 2006 10:21:22 -0600 Tim Daneliuk wrote: > Randy Pratt wrote: > > > On Sun, 19 Feb 2006 15:25:49 -0600 > > Tim Daneliuk wrote: > > > > > >>Where is the default path for cron jobs established? (And can it > >>be changed...) > >> > > > > > > Take a look at: > > > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-cron.html > > > > and see if that answers your question. > > > > Best regards, > > > > Randy > > -- > > > > Well ... it answered my question partially. But as I looked back over > it, I realized my central questions are still unanswered: > > If I do not have a PATH= statement in a particular user's crontab, > what is used for a default PATH? >From "man 5 crontab" : Several environment variables are set up automatically by the cron (8) daemon. SHELL is set to /bin/sh, PATH is set to /usr/bin:/bin, and LOGNAME and HOME are set from the /etc/passwd line of the crontab's owner. HOME, PATH and SHELL may be overridden by settings in the crontab; LOGNAME may not. > Is the path in /etc/crontab inherited somehow? > > Given that the default shell is /bin/sh, are the settings > in /etc/profile observed? If no PATH is established there either, > what will cron use? > > I am trying to determine the best place to establish correct global > PATH settings for all cron users so I don't have to edit each users' > crontab file when file locations are updated or changed. It seems that the PATH is being set in the source code, in particular /usr/src/usr.sbin/cron/cron/pathnames.h : #ifndef _PATH_DEFPATH # define _PATH_DEFPATH "/usr/bin:/bin" #endif I suppose its possible to change the source and rebuild but there may be subtle interactions that aren't readily apparent that would need to be considered. There may even be a knob to tweak somewhere for this. Sorry I can't give you a definitive answer on this. Perhaps someone with more direct experience can give you proper guidance here. Best regards, Randy --