2

I have a server running Ubuntu Server 11.10 and I have some programs I want to start at boot time such as Nginx, my Unicorn workers etc.

In fact, I know how to start my programmes either by adding a script to /etc/init.d/ or to /etc/init/ via Startup.

What I want to know is if there is a "good way" or "best way" to do it. Maybe there is a more sustainable way considering the future evolutions of Ubuntu.

2 Answers 2

3

As with all things Linux, there are a bunch of different ways to do this.

The best way, though, is to write upstart files for the apps you need to start on boot. Upstart replaces the legacy sysV init system.

2
  • The real question is, how did he manage to install nginx without getting an init script?
    – devicenull
    Feb 24, 2012 at 0:27
  • When you install Nginx via apt, you get a nginx file in /etc/init.d/. I just removed it and replaced it with a file in /etc/init/.
    – 4e4c52
    Feb 24, 2012 at 0:35
0

What I do is make a copy of /etc/init.d/skeleton and adjust it to my needs. It's quite simple and I think it's the best way to implement starting up things at boot time. Don't forget to run "update-rc.d name-of-app defaults" or something similar to enable it.

Alternatively you can edit /etc/rc.local to your needs. No need to run update-rc.d in that case.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .