LSB compliant init script (e.g. Debian 7)

Richard Fussenegger, BSc richard at
Fri Jan 3 10:54:25 UTC 2014

Hi Maxim,

thanks for your answer.

On 1/3/2014 5:18 AM, Maxim Dounin wrote:
> Hello!
> On Tue, Dec 31, 2013 at 01:35:52PM +0100, Richard Fussenegger, BSc wrote:
>> I also happen to have a LSB compliant init script for nginx. I think some
>> lines should be removed for inclusion in the nginx source (everything that
>> has to do with the temporary paths), but it's a rock solid starting point.
> There are collection of various init scripts here on wiki:
I'll add a link there in that case.
>> The script allows you to use "service nginx
>> {force-reload|reload|restart|start|status|stop}" and "nginx -t" is always
>> executed before attempting to do anything. This ensures that the service
>> isn't interrupted because of some misconfiguration. It's also using the
>> various LSB functions for some eye candy.
> Just a side note: nginx reload is a correct way to avoid service
> interruptions, as it doesn't apply a configuration if there are
> problems.  On the other hand, "nginx -t" may produce incorrect results if
> nginx binary in memory doesn't match one on disk (e.g., in the
> process of upgrade), and forcing "nginx -t" would be a wrong thing
> to do.  Note well that in some cases (e.g., before start or stop)
> calling "nginx -t" is useless would be a plain waste of resources.
I always thought nginx -t is mainly useful to check the configuration 
files and calling it would be useful so one doesn't try to start / 
reload if the configuration is wrong.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4264 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the nginx-devel mailing list