pythonlinuxarmraspberry-piinit.d

Starting a python script at boot - Raspbian


I have a python script. This script is essentially my own desktop/UI. However, I would like to replace the default Raspbian (Raspberry Pi linux distro) desktop enviroment with my own version. How would I go about:

  1. Disabling the default desktop and
  2. Launching my python script (fullscreen) at startup?

This is on the Raspberry Pi running a modified version of debian linux.

(Edit: I tried making a startup script in the /etc/init.d directory, and added it to chmod, but I still can't seem to get it to start up. The script contained the normal .sh stuff, but also contained the python command that opened the script in my designated directory.)


Solution

  • Ah bah, let's just give a quick answer.

    After creating a script in /etc/init.d, you need to add a soft-link to the directory /etc/rc2.d, such as sudo ln -s /etc/init.d/<your script> /etc/rc2.d/S99<your script>. Assuming, of course, that you run runlevel 2. You can check that with the command runlevel.

    The S means the script is 'started', the number determines the order in which processes are started.

    You will also want to remove the entry from rc2.d that starts the graphical environment. What command that is depends on how your pi is configured.