Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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
share|improve this answer
    
I would like to call a shell script on startup, that contains some xmodmap directive for meyboard layout... Should I put it in /etc/local.d/myscript.start...? –  Piero Jun 4 '13 at 21:34
1  
    
+1 but this is quite outdated though... –  Piero Jul 25 '13 at 10:39
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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