Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 12.04 and Nginx 1.2.1 which I compiled from source. I tried the below commands to get nginx to start on boot:

$ sudo update-rc.d nginx default
$ sudo update-rc.d nginx enable 2345

In both cases I'm getting the following error:

update-rc.d: warning: nginx start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: nginx stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)

What I don't understand is that my /etc/init.d/nginx script seems to have the proper init information:


# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon

What do I need to change for the update-rc.d command to function?

share|improve this question
Did you try managing this using sysv-rc-conf? – Khaled Jun 19 '12 at 13:57
Did you ever figure out this issue? I have the same problem with an init.d script and I can't figure out why I'm getting this error either. – Coomer Dec 1 '12 at 3:27
@Coomer: no, I've put this issue on hold for now as I have other matters to deal with at the moment. – Max Dec 3 '12 at 8:49

I recommend a different approach, which will address the start-on-boot issue, as well as make Nginx easier to manage on Ubuntu in the future.

Set yourself up with the official Nginx Ubuntu PPA.

I presume you are customizing some compile-time options, for the pre-built binaries won't work for you. So instead, use some commands to download the package source. Then modify the compile options in that package as needed, and build your own custom package and install that.

The result will a package much like the the the official one, that you can manage like your other packages. You can also save your "patch" that you've created to the default package, to make it easier to repeat the process in the future.

A tutorial for rebuilding Debian/Ubuntu packages is here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.