Making cron stop overriding PATH?
Julian Andres Klode
julian.klode at canonical.com
Fri Feb 12 20:53:33 UTC 2021
So,
it seems that cron defines two PATH right now. Stuff launched from
/etc/crontab - e.g. /etc/cron.daily and friends - get a PATH _similar_
to the normal one, except that:
- /{s,}bin comes before /usr/{s,bin}
- /snap/bin is missing
It is:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
(see /etc/crontab)
Cron jobs launched in user sessions just get the PATH=/usr/bin:/bin, not
even /usr/local dirs. You'd expect that it would be the other way
around, with /usr/local missing for system wide jobs (which might come
preinstalled), but available in user jobs.
We're considering removing those PATH overrides and have cron inherit
PATH from pam_env, and I'm looking for some feedback, and maybe someone
has an insight into the background of why this is the way it is.
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
More information about the ubuntu-devel
mailing list