2

I created an init script in LSB format, and copied it to the /etc/init.d directory. I can manually start, stop, status the service and all works fine. I then try to set the service to auto stop/start with runlevels by doing:

update-rc.d service defaults

and I see warnings like:

update-rc.d: warning: xxx start runlevel arguments (none) do not match lsb default-Start values (3 4 5).

and initctl list" does not show my service. Is there a step I need to do to make this service register or appear properly? (I know on RedHat it's "chkconfig --add xxx) but I don't know Ubuntu well enough.

  • 1
    update-rc.d service defaults, with an s at the end. – chaos Feb 7 '14 at 21:38
  • I fixed that typo. Confirmed that result is the same, "initclt list" still does not show my service (but I do see the S symlink in the /etc/rc3.d/ directory for my service). Am I perhaps misunderstanding which initctl list should show? – TSG Feb 7 '14 at 21:48
  • See my answer^^ – chaos Feb 7 '14 at 21:53
1

initctl is part of Uubuntu's upstart mechanism. initctl list only shows you the status of upstart-jobs. Your script is indeed is a SysV init script.

To list the status of SysV init script use this command:

service --status-all

Your service should be listed there.


To create links in the /etc/rcN folders use the following command:

update-rc.d your_init_script defaults

From the manpage of update-rc.d:

If defaults is used then update-rc.d will make links to start the service in runlevels 2345 and to stop the service in runlevels 016.

  • OK I'm getting it now. So why this error then: update-rc.d: warning: xxx start runlevel arguments (none) do not match lsb default-Start values (3 4 5). Where is it getting "(none)" from? My scripts has default start values of 3 4 5. – TSG Feb 7 '14 at 22:18
  • Because the lsb-headers of your script say 3 4 5 but defaults means add the scripts to 2 3 4 5. – chaos Feb 7 '14 at 22:29
  • Then how can I add init script? (If I remove the word defaults I get errors) – TSG Feb 8 '14 at 1:54
  • 1
    Use this command: update-rc.d your_service start 20 3 4 5 . stop 20 0 1 6 .. This means, start the service in runlevels 2, 3 & 4 and stop the service in runlevels 0, 1 & 6. 20 is the order (see the /etc/rc*/ dirs). – chaos Feb 8 '14 at 14:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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