2

Hi tried to add my nagios service to the runlevel 1-5 (or at least 2). But when I used the command

sudo update-rc.d nagios default

I received the error

update-rc.d: warning: /etc/init.d/nagios missing LSB keyword 'default-start'

update-rc.d: warning: /etc/init.d/nagios missing LSB keyword 'default-stop'

usage: update-rc.d [-n] [-f] <basename> remove
   update-rc.d [-n] <basename> defaults [NN | SS KK]
   update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
   update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
            -n: not really
            -f: force

The disable|enable API is not stable and might change in the future.

Since there are only symbolic links in the /etc/rc2.d folder my next idea would be to just simple create a symbolic link to the binary. But I am not sure if this is a good idea since there must be a reason for a existing update-rc.d program?

I am using Ubuntu 14.04.

1 Answers1

3

the all-important letter 's'

You've missed the obvious. You typed

update-rc.d nagios default
and the command told you that the syntax was

update-rc.d [-n]  defaults [NN | SS KK]
Note the spelling: defaults

broken nagios LSB headers

As for the warnings about the nagios LSB headers: As I've said at https://unix.stackexchange.com/a/200281/5132 and at https://askubuntu.com/a/617822/43344, you're far better off not starting from there in the first place. The Nagios Enterprises supplied System 5 rc script doesn't have a proper, complete, set of LSB headers. But it's foolish to waste time fixing it.

You're using Ubuntu Linux. You have upstart here with version 14, and you'll have systemd if you ever upgrade. Begin with a systemd unit file, or an upstart job file.

  • For systemd, you could do worse than start with this nagios.service file written by David Kowis.
  • For upstart, you could do worse than start with the nagios.conf file written by Remy van Elst that is part of a guide to installing nagios on your very version of Ubuntu.

(If you really must: The Debian people have fixed it in their nagios3 source package and so has someone named "djibril".)

Further reading

JdeBP
  • 3,959
  • OK thanks. The command worked now with sudo update-rc.d thruk defaults but with the nagios service I still get the LSB error. – user3772108 May 04 '15 at 08:45