I'm trying to write an init script which will be able to handle basic dependencies (for example, It has to be started (just) before MySQL service starts). Is there a distro agnostic way to write such a script? And if not, how many version of the init script would there have to be to cover Ubuntu, Debian and RHEL/Centos (5.x and 6.x)?