3

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:

#!/bin/sh

### BEGIN INIT INFO
# 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
### END INIT INFO

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

Max
  • 3,373
  • 15
  • 51
  • 71
  • 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 01 '12 at 03: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 03 '12 at 08:49

1 Answers1

1

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 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.

Mark Stosberg
  • 3,771
  • 23
  • 27