Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crontab $PATH #155

Closed
wants to merge 1 commit into from
Closed

Update crontab $PATH #155

wants to merge 1 commit into from

Conversation

benrubson
Copy link

Hi,

This PR sets $PATH in /etc/crontab like it is set by the cron(8) daemon, for consistency.
It then solves https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213742.

Thank you 馃憤

Ben

@bsdimp
Copy link
Member

bsdimp commented Jun 9, 2018

Cron's default path is actually pathnames.h:# define _PATH_DEFPATH "/usr/bin:/bin". Where do you get that it is PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin?

@benrubson
Copy link
Author

benrubson commented Jun 9, 2018

From crontab(5) :

Several environment variables are set up automatically by the cron(8)
daemon.  SHELL is set to /bin/sh, PATH is set to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/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.

@bsdimp
Copy link
Member

bsdimp commented Jun 10, 2018

I'm sold. I found that the #define I found was #ifndef _PATH_DEFPATH, which is set globally.

@bsdimp
Copy link
Member

bsdimp commented Jun 10, 2018

r334909

@bsdimp bsdimp closed this Jun 10, 2018
@bsdimp
Copy link
Member

bsdimp commented Jun 10, 2018

And thanks!

uqs pushed a commit that referenced this pull request Jun 10, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: #155


git-svn-id: svn+ssh://svn.freebsd.org/base/head@334909 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
uqs pushed a commit that referenced this pull request Jun 10, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: #155
@benrubson
Copy link
Author

Thank you too @bsdimp 馃憤
Do you think we could still be in time for a backport to 11.2 ?
Or at least to stable/11 ?
Thank you again !

@benrubson benrubson deleted the cronpath branch June 10, 2018 07:38
@bsdimp
Copy link
Member

bsdimp commented Jun 10, 2018

11.2, impossible.
11-stable, quite possible. But you'll have to remind me. I'm likely to forget.

mat813 pushed a commit to mat813/freebsd that referenced this pull request Jun 11, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: freebsd#155


git-svn-id: https://svn.freebsd.org/base/head@334909 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bdrewery pushed a commit to bdrewery/freebsd that referenced this pull request Jun 13, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: freebsd#155


git-svn-id: svn+ssh://svn.freebsd.org/base/head@334909 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
grimreaper pushed a commit to grimreaper/freebsd-git-svn that referenced this pull request Jun 14, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: freebsd/freebsd-src#155


git-svn-id: svn+ssh://svn.freebsd.org/base/head@334909 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
brooksdavis pushed a commit to CTSRD-CHERI/cheribsd that referenced this pull request Sep 5, 2018
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: freebsd/freebsd-src#155
uqs pushed a commit that referenced this pull request Dec 14, 2018
Set the  $PATH in /etc/crontab like it is set by the cron(8)
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: #155
mat813 pushed a commit to mat813/freebsd that referenced this pull request Dec 17, 2018
Set the  $PATH in /etc/crontab like it is set by the cron(8)
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: freebsd#155


git-svn-id: https://svn.freebsd.org/base/stable/11@342103 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
@emaste emaste added the merged label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants