fixedCron $PATH invalid
Bug introduced in 1.56.1:
where $PATH is not a valid variable to be set for PATH= in a cron.
New internal default now changed to for 1.56.2:
but you can set it to:
if you wish to use it with the new logic, which should be ok now.
Updates to 1.56.1 done after about "1pm MST" April 9th are should have:
so you'd be fine. Confirm if you have that:
./directadmin c | grep set_php_bin_path_in_crons
If you save a cron with this feature enabled, you might get something like:
which should appear fine, but the issue is that cron does not support $PATH variables, it must be fully expanded.
As a result, our path is only:
so simple global calls like "ls" or "grep" won't be found.
WORKAROUND for 1.56.1:
If you're an end-User with ssh, you can edit your crontab using:
and delete the PATH line.
For Admn's, use this in the directadmin.conf:
and hunt for any affected Users with:
grep '$PATH' /var/spool/cron/*
grep '$PATH' /var/spool/cron/crontabs/*
upon updating to DirectAdmin 1.56.2, the scripts/update.sh will call:
echo 'action=rewrite&value=cron_path' >> /usr/local/directadmin/data/task.queue
which will hunt in all crons for 3 cases which must be true:
The PATH= must start with the /usr/local/phpXX/bin
The PATH= must contain $PATH
The timestamp on the crontab file for this User must be newer than March 20th, as the bug didn't exist before this.
If any of the above are false, the user is skipped, and no swapping happens.
If it's just the 2 values, then:
if set_php_bin_path_in_crons==0, then the PATH is removed completely.
for cases where there are more than 2 entries, DA will swap $PATH with the Users' current $PATH (obtained via su and other means)
If it's more than 2 PATH values, then more issues were at play and it's assumed you do want a custom entry so DA will replace $PATH with the User's path.
Note: it's not easy to obtain the User's true PATH in the even the User does not have a shell enbabled.
For this case, DA will use the cron internal PATH default, as per the FreeBSD man page for CRONTAB(5), plus /home/username/bin added to the list.
For all OS, in the event DA cannot get the User's path (when it's trying to do so), the same default will be assumed:
for example (XX replaced with php version)