Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Ubuntu 11.10 and I've to execute a shell commands at the startup.

java -jar selenium....

I tried with this but nothing:

sudo gedit /etc/init.d/nomescript.sh 
sudo chmod a+x /etc/init.d/nomescript.sh
sudo update-rc.d nomescript.sh defaults

Do you know how I can do this?

Thank you!! Marco

share|improve this question
    
If programs in your script depend on other resources being up and running, you need to specify priorities in your update-rc.d command. –  RedGrittyBrick Apr 18 '12 at 14:20
add comment

2 Answers

up vote 0 down vote accepted

Ubuntu has abandoned SysV init script approach to booting the system.

This link explains how to create an Upstart script and how to run it at boot - http://www.linuxplanet.com/linuxplanet/tutorials/7033/1/

share|improve this answer
    
Ok, it works.. Thanks!! –  Mark Design Apr 23 '12 at 10:34
    
You're welcome. –  bryan Apr 23 '12 at 14:20
    
I don't understand a thing: if I execute the shell command at the startup it works but selenium gives me an error, if I execute the same command in the terminal all works.. –  Mark Design May 2 '12 at 8:09
add comment

You could add a line to your crontab:

@reboot command here

That pretty much guarantees it won't happen more than once (like /etc/rc.local or gnome sessions) It also lets you ensure it is run as the correct user very easily.

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.