-1

So here are the steps i am following . So i add a conf file inside

/etc/init.d/myconffile 

And then to get System start/stop links i have to use the command

sudo update-rc.d myconffile defaults 99 2 3 4 5

And then if i reboot Ubuntu server the system will auto start the service . But what i want is that when the system starts for the first time this service is started . Is there a way to do it . I have been reading all around about this but was not able to find anything. Please let me know if you can think of a way

raj
  • 1
  • What is exactly that you want? Please explain it better. – machineaddict Aug 14 '14 at 13:32
  • This doesn't sound like a good idea. Sounds like one of those programs, where you are told to reboot to complete installation. Ubuntu users expect better than that. So why would you make the first boot after your package is installed different from the following? Keep in mind, that after the service has been installed, it could be several months before the server is rebooted the next time. – kasperd Aug 14 '14 at 14:29

1 Answers1

1

I might not understand your question correctly, but:

If you want to to it during the "initial setup" of the server you might need some configuration management tool like chef or puppet.

Otherwise to just start it after you installed the service without the need of a reboot:

/etc/init.d/myservice start or service myservice start

will most likely start it.

Dennis Nolte
  • 2,881
  • 4
  • 27
  • 37
  • I want the start to be automated. Like say the dnsservice or ssh service. We dont run an update-rc on them. So when we start the box, we have the service running. Here we will need to issue update-rc command and then on reboot we get the service started automatically. I wanted to skip this update-rc command – raj Aug 14 '14 at 18:28
  • so read the update-rc script and execute the command executed there... – Dennis Nolte Aug 18 '14 at 07:20