With BASH_ENV
assigned in /etc/environment
I noticed that it doesn't affect cron jobs.
I figured out that having SHELL=/bin/bash
in a users' crontab does the trick! Yes! If I simply add (to the crontab):
SHELL=/bin/bash
... it works. I can go in as root and do a simple:
sed -i 1iSHELL=/bin/bash /var/spool/cron/*
However, I'd like to have this setting global (or the default).
Is it possible to set default cron SHELL as bash?
I've already tried the following, none of which did the trick:
- Adding the line in
/etc/crontab
effects only the /etc/crontab itself not all users - Adding to
/etc/sysconfig/crond
and restart the cron - Adding to
/etc/environment
and cron restart - Added
session required pam_env.so readenv=1
to/etc/pam.d/crond
and restart cron - Added line to
/etc/default/cron
and another restart
How to set default cron SHELL as bash?