Init.d script

How should a nginx script in init.d for automatic restart look like on
Debian 5?

Pål Bergström wrote:

How should a nginx script in init.d for automatic restart look like on
Debian 5?

Can this work?

Or this:

http://articles.slicehost.com/2007/10/19/debian-etch-adding-an-nginx-init-script

I have nginx installed in /opt/nginx. Can I just change this?

DAEMON=/usr/local/sbin/nginx

To

DAEMON=/opt/nginx/sbin/nginx

Will it work?

Btw, why the PATH variable in the script if it’s not used in the script?

David J. wrote in post #967875:

On 12/11/10 5:31 PM, Paul B. wrote:

DAEMON=/opt/nginx/sbin/nginx

Will it work?

Btw, why the PATH variable in the script if it’s not used in the script?

Yes. Look at the other vars as well and just point them to where they
are on your setup;

Do I need to add it to update-rc? Not sure what that does.

On 12/11/10 5:31 PM, Paul B. wrote:

DAEMON=/opt/nginx/sbin/nginx

Will it work?

Btw, why the PATH variable in the script if it’s not used in the script?

Yes. Look at the other vars as well and just point them to where they
are on your setup;

Paul B. wrote in post #967901:

David J. wrote in post #967875:

On 12/11/10 5:31 PM, Paul B. wrote:

DAEMON=/opt/nginx/sbin/nginx

Will it work?

Btw, why the PATH variable in the script if it’s not used in the script?

Yes. Look at the other vars as well and just point them to where they
are on your setup;

Do I need to add it to update-rc? Not sure what that does.

I did. Hopefully it will restart now when the server restart.