[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: root crontab @reboot for loop fails



On Sat, Jul 16, 2022 at 05:35:39AM +0100, Gareth Evans wrote:
> On Sat 16 Jul 2022, at 05:30, Gareth Evans <donotspam@fastmail.fm> wrote:
> 
> > Why isn't root's $PATH available to root crontab? ie. including the 
> > link /sbin -> /usr/sbin?
> 
> By which I mean: why can't root crontab do everything sudo can do?

Because they're different programs.

crontab(5):

       Several environment variables are set up automatically by  the  cron(8)
       daemon.  SHELL is set to /bin/sh, and LOGNAME and HOME are set from the
       /etc/passwd  line  of  the   crontab's   owner.    PATH   is   set   to
       "/usr/bin:/bin". [...]

Debian's /etc/sudoers file:

Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

So, it depends on whether you're using the default settings, or changing
them.


Reply to: