3

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

1
  • If programs in your script depend on other resources being up and running, you need to specify priorities in your update-rc.d command. Apr 18, 2012 at 14:20

2 Answers 2

0

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/

1
  • 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.. May 2, 2012 at 8:09
1

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.

You must log in to answer this question.

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