简体   繁体   中英

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. Thanks in advanced!

(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.)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM