Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a simple upstart script that kicks off a python program, I have it saved as vgpusher.conf.

It doesn't start automatically, but if I run sudo start vgpusher it starts and runs just fine.

The code is simple:

description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

    cd /home/computer/
end script

I placed the script in /etc/init. Other than that, I have done no configuration.

The machine is running Ubuntu 10.04 Server.

Do I need to take an extra step for the service to start on startup?

share|improve this question
Please explain in more detail how you have configured your script as a service: where did you put vgpusher.conf, what is the contents of this file, where did you set the runlevel etc. – January Jul 8 '13 at 14:34
@January Added more information, thanks – mitchfish36 Jul 8 '13 at 14:42
up vote 3 down vote accepted

First, you don't need script:

description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

chdir /home/computer
exec python

Second, it may help to log the output. If you upgrade to 12.04 (Highly recommended!) you will have a log in /var/log/upstart/$jobname.log. For 10.04, you have to do it manually:

description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

chdir /home/computer
exec python 2>&1 >> /var/log/vgpush.log

That may give some clue. If I had to guess, it is because vgpush needs a network interface to be up that is not, and 10.04 starts runlevel 2 before all network interfaces are ready.

share|improve this answer

When troubleshooting an upstart job, there are a few things to check.

  1. Check the upstart job is correct. Yours looks pretty good, but I would suggest using the full path to the python executable ( /usr/bin/python ).

  2. Check the upstart job log. there is a log file for each job at /var/log/upstart/.log It's possible that your job is starting and failing for some reason (maybe needs the network to be up) and this log file will probably have information on that. At the least, it will at least show if the job is trying to start.

share|improve this answer
Using an explicit python path is not necessary. PATH will be set to the system default and the system python will always be in the default system path. – SpamapS Jul 8 '13 at 17:10

Your Answer


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.