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 want to run /home/myuser/go.py

How do I make that run in the background, everytime my linux machine boots up?

share|improve this question

migrated from stackoverflow.com Jun 22 '10 at 19:10

This question came from our site for professional and enthusiast programmers.

general what-happens-on-ubuntu-startup here: superuser.com/questions/151330/ubuntu-control-the-init-startup ... this might be "close enough" to consider a duplicate. –  quack quixote Jun 22 '10 at 19:46

4 Answers 4

You can put a script in the /etc/init.d/ directory (eg: /etc/init.d/go.py) for anything you want to run at bootup time.


share|improve this answer
I prefer /etc/rc.local as you do not need to change the run-level links. –  Dirk Eddelbuettel Jun 22 '10 at 19:05
@DirkEddel - I agree to that! –  BloodPhilia Jun 22 '10 at 19:12
Perhaps you should add this as a separate answer so it can be voted up? –  Steve Homer Jun 22 '10 at 20:48

Simple way

You can add this script into /etc/rc.local file e.g.

/home/myuser/go.py &

Where & at the end make the script to go background.

Make sure that you've execution flags. To test it, simple run:

sh /etc/rc.local
share|improve this answer

There are many ways to do this (depending on which distribution of linux you are using there are different tools that are offered).

The easiest way is simply adding the script to /etc/init.d and then running the command

chmod +x go.py
update-rc.d go.py defaults

If you already set up the service, you may also do so via the chkconfig command (that is if the command is available).

In that case, this command should work:

chkconfig --level 35 go.py on

Check out THIS WEBSITE, more specifically the "Using chkconfig to Start Daemons at Each runlevel" and "Using sysv-rc-conf to Start Daemons at Each runlevel" sections.

share|improve this answer

cron has a special @reboot option that allows for this. Nice and simple.

A normal cron task might be:

* * * * * /path/to/app

A @reboot cron task might be:

@reboot /path/to/app
share|improve this answer

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.