Nginx as a Linux Service

Jim Ohlstein jim.ohlstein at
Mon Nov 17 21:04:59 MSK 2008

Try using the start-stop-daemon:

# wget

# tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz

# cd apps/sys-utils/start-stop-daemon-IR1_9_18-2/

# gcc start-stop-daemon.c -o start-stop-daemon

# cp start-stop-daemon /usr/sbin/

Then use the init script at Copy it to /etc/init.d/nginx and chmod to 755. Then you can add nginx to chkconfig. That script assumes that you have nginx in /usr/local/sbin/. If it's elsewhere adjust the path.

Good luck.


-----Original Message-----
From: owner-nginx at [mailto:owner-nginx at] On Behalf Of Chris Gers32
Sent: Monday, November 17, 2008 9:16 AM
To: nginx at
Subject: RE: Nginx as a Linux Service

Well well, here's a new problem:

[chris at localhost ~]$ sudo /sbin/chkconfig nginx on
service nginx does not support chkconfig
[chris at localhost ~]$ nginx -v
nginx version: nginx/0.6.32[chris at localhost ~]$ /sbin/chkconfig -v
chkconfig version

Am I not running the right version of either nginx or chkconfig (came by 
default with my RHEL 4.4 virtual appliance)?


Posted via

More information about the nginx mailing list