It seems that many init.d scripts return 0 on failure, in spite of these recommendations. For example, in nginx, running directly:/usr/sbin/nginx -t        # returns 1 (with a bad config)and running via init.d:service nginx configtest  # returns 0 (with a bad config)What's the best way of managing the missing status code? It seems there are a few options:Parse the output looking for 'fail' whenever you call the command.Update the init.d scripts to honour the expected codes described here.Update log_end_msg in /lib/lsb/init-functions so that it does the usual logging and then exits with the exit code it is given initially.
How to find status of init.d exit scripts which return 0 on failure?
init script;init.d;exit;return status