Bug 184409

Summary: [request] crontab(5) environment should include common paths like /sbin or /usr/sbin
Product: Base System Reporter: patdung100
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: patdung100
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description patdung100 2013-12-01 14:20:00 UTC
By default, user's crontab would have below environment variables 

LOGNAME=user1
PATH=/usr/bin:/bin
PWD=/usr/home/user1
HOME=/home/user1
USER=user1
SHELL=/bin/sh

When the script is invoked/test in command line, it worked.
When the script is invoked by cronjob, some part of the script failed
to run because /usr/sbin/chown is not in the search PATH.

It is not convenient.

Fix: 

configure user's crontab to include PATH like /etc/crontab

PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
How-To-Repeat: always
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:51:26 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 2 patdung100 2018-05-21 05:04:14 UTC
(In reply to patrick_dkt from comment #0)

comment #0 had typo, it should be:

PATH=/bin:/sbin:/usr/bin:/usr/sbin

(/etc should not be added)