0

I want to run svc service (daemontools/supervise) on system boot (without logging in).

The service is running fine if I manually run commands (using root):

  • /usr/bin/svscan /services/ &(to start supervise)
  • /usr/bin/svc -u /services/demoservice (to start demoservice)

But I want to run these on system boot. I created entries in /etc/rc.local. first command starts supervise on boot but second command is not working.

Please help.

0

svscan takes a non-zero amount of time to start up the supervises, and they in turn take a non-zero amount of time to present the control/status API for the services that svcthen uses. You cannot expect svc -u, run in parallel whilst this is happening, to work. But you don't need to run svc -u at bootstrap in the first place, to autostart something that is in /services and not configured as down.

You don't need to use the old rc.local when Gerrit Pape has made the daemontools-run package. And in any case the command to run in the old rc.local way of doing things is svscanboot. However, you are using Ubuntu Linux, and have had no need of the old rc.local way of doing things for the past ten years.

On Ubuntu 15, run svscan under systemd with a path unit and a service unit. On Ubuntu 14, run svscan under upstart with a job file.

Further reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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