Changing default shell for Cron
Denys Vlasenko
vda.linux at googlemail.com
Wed Apr 30 15:40:41 UTC 2014
On Mon, Apr 28, 2014 at 7:23 PM, Rob Anderson <rca93 at hotmail.co.uk> wrote:
> I have compiled Busybox for Android with a fully working cron. However, when
> I try to run crond/crontab, I get the following output in the log;
>
> "crond: can't execute '/bin/sh' for user root"
>
> Unfortunately, I have tried all the usual suggestions on the internet e.g.
> adding PATH and SHELL to the cron but to no avail (I can get cron working
> perfectly by symlinking /system/bin/sh to /bin/sh but I do not like this
> method). Is it possible to hardcode a different default shell path into the
> Busybox source for cron to execute e.g. the default /system/bin/sh for
> Android? If so, could you please advise whereabouts in the source this
> change needs to be made?
libbb.h:
/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
* use bb_default_login_shell and following defines.
* If you change LIBBB_DEFAULT_LOGIN_SHELL,
* don't forget to change increment constant. */
#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh"
extern const char bb_default_login_shell[] ALIGN1;
/* "/bin/sh" */
#define DEFAULT_SHELL (bb_default_login_shell+1)
/* "sh" */
#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6)
Meanwhile, I added support for SHELL=prog in crond.
More information about the busybox
mailing list