systemd and nginx custom script

Jamie Nguyen jamie at
Wed May 16 20:05:32 UTC 2012

On 16 May 2012 18:28, Maxim Dounin <mdounin at> wrote:
> Hello!
> On Wed, May 16, 2012 at 06:01:47PM +0100, Jamie Nguyen wrote:
>> Hi, I am co-maintainer for nginx Fedora package. We would like to
>> upstream our systemd service file. Could you consider including it in
>> the nginx tarball?
> We don't usually include any init scripts in distribution and
> usually rely on package mainterners to provide one appropriate for
> a system in question.

No problem.

> If you think the file will be usable for ones who compile
> nginx from source, you may place it here on wiki:

Good idea. Done!:

>> ExecReload=/usr/sbin/nginx -s reload
>> ExecStop=/usr/sbin/nginx -s quit
> Just a side note: using "-s ..." on unix might not be a good idea,
> as it needs nginx binary compatible to one already running to be
> able to parse config for a pid file name and sent appropriate
> signal.  It was introduced mainly for Windows.  On unix-like
> systems it's more fail-safe to explicitly send appropriate
> signals.

No problem. I've changed it to:

ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID

> Just a side note 2: your service file obviously rely on
> non-default configure arguments, you may want to explicitly state
> this when placing it on wiki (or change the file to match
> defaults).

I've added a comment in the wiki page.

Thanks very much for your advice :-)

Kind regards,

More information about the nginx-devel mailing list