Re: Path And 'cron'



On Mon, 20 Feb 2006 10:21:22 -0600
Tim Daneliuk <tundra@xxxxxxxxxxxxxx> wrote:

Randy Pratt wrote:

On Sun, 19 Feb 2006 15:25:49 -0600
Tim Daneliuk <tundra@xxxxxxxxxxxxxx> 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


--
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Loopback Processing and Deny Apply in ACL
    ... > regards to the GPO's getting applied then what will ... > actually get applied at logon in regards to loopback policy's and setting ... The computer configuration settings from this list are applied to the ...
    (microsoft.public.win2000.group_policy)
  • Re: Splitting/Combing data question
    ... settings. ... > Regards and thanks. ... > "Frank Kabel" wrote in message ... >>> Checked by AVG anti-virus system. ...
    (microsoft.public.excel.programming)
  • Re: Screen saver does not start
    ... Go to Start/Administrative Tools/Services/Themes. ... Also check your settings here: ... Restore Themes Functionality ...
    (microsoft.public.windows.mediacenter)
  • Re: It is not the case
    ... >>> settings, I've got strange webproxy log entries saying that the ... >>> browser is not configured as web proxy client of local web proxy> service, ... >>> Regards, ...
    (microsoft.public.isa)
  • Re: Spontan reboot of FreeBSD 4,x box
    ... cron is'nt running? ... Regards, ... bug you have in the kernel, or bad memory. ... a fbsd file system if you wish to try the bad memory theory ...
    (freebsd-net)