May I propose the attached patch.
Points to note and possibly discuss:
(a) Only exit codes in do_* functions have been changed.
(b) The link to, and the version of, LSB specifications has been updated.
(c) A significant change is the exit code of do_stop() on stopping a stopped server. Previous return is 1. Proposed return is 0. If this is accepted, I would highly suggest a mention in the Release Notes.
(d) The exit code that raised this issue was the return of promoting a promoted server. If promotion fails because the server is running but not as standby, should that be considered a case of starting a started service, or an application specific failure? I am equally weighted to opt for the former, but have proposed differently in the patch.