4

I own a VDS running Gentoo Linux and I am curious about how to execute specific bash script at startup of my VDS.

I just want to startup apache2 at boot time and run two thin instances.

Eskat0n
  • 143
  • 1
  • 5

2 Answers2

5

If your service already has an init script, you can add it to the default runlevel by running:

# rc-update add apache2 default

If not, depends on which services system you're using, add your scripts to the /etc/conf.d/local.start or /etc/local.d/baselayout1.start, something like this:

cd /path/to/your/app && thin start
quanta
  • 50,327
  • 19
  • 152
  • 213
2

To add apache2 at boot time:

$ rc-update add apache2 default

To start the script manually

$ /etc/init.d/apache2 start

Also a really useful command is rc-update -v show which will show all the available init scripts and list at which runlevels they will execute.

golja
  • 1,611
  • 10
  • 14