The init script /etc/init.d/motion (from files/motion.init) should contain: depend() { need modules mysql } when mysql is used by motion Reproducible: Sometimes
I've added "after mysql" to it. Thanks for reporting.