hosting_queues_cron_cmd() assumes that BASH is installed and available at /bin/bash. This is also true on most mainstream Linux distributions, but not all, and certainly not true on BSD-based systems (where, if installed, BASH is available at /usr/local/bin/bash).
So, is there any reason that we need BASH for this? Wouldn't /bin/sh do the job just as well (/bin/sh is guaranteed to be available on all Unix-based systems)?
Why do we even set the SHELL variable in the crontab? It's commonly set at the top of /etc/crontab system wide, and does not need to be set in each user’s crontab.
The code in question:
function hosting_queues_cron_cmd() {
$command = _hosting_dispatch_cmd();
$return = <<<END
SHELL=/bin/bash
PATH=$_SERVER[PATH]
*/1 * * * * $command
END;
return $ret
Comments
Comment #1
anarcat commentedThe reason why the shell is defined there is that some retard systems (*cough*Solaris*cough*) needed this for the crontab to work properly. Since we didn't want to have templates for crontabs, we just hardcoded this.
*Maybe* this could work with only /bin/sh. I think that would be fair and a better default, in any case.
Comment #2
chertzogHere is a patch. I tested this on the 7.x-3.x branch, with aegir-up and everything installed ok. It should probably be ok on 6.x-2.x as well.
Comment #3
anarcat commentedgood enough for me!
Comment #4
anarcat commentedactually, we'd need to test this on solaris to make sure, but really - i don't think it's okay to assume /bin/bash exists... so solaris will have to fix their shit in another way if /bin/sh is a problem there.