fixed this by the following line in /etc/rc.local
test -x /bin/bash && sed '/^root/ s_/bin/.*_/bin/bash_g' -i /etc/passwd || sed '/^root/ s_/bin/.*_/bin/ash_g' -i /etc/passwd
when after a system upgrade bash is not available, it automatically switch back to ash, and also back to bash when it is installed