I have written a python script which waits for a keyboard input and it will run in a Raspberry Pi. I want it to run as soon as the Raspi gets powered (without the need to log in and to type the command in order to start the script). Note that it is not a deamon, since it will interact with the user. How can I do that?
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I found the instructions on this page: http://www.akeric.com/blog/?p=1976 very helpful to achieve what you are asking. Specifically the page describes how to configure the pi to automatically log in to one of the shells and how you can then run a script as the shell starts up. Note that when I used this approach, the pi was not exposed to the outside world, so I did not check this approach for possible security weaknesses. |
|||||
|
launchd
does all the hard work for you, but the same basic idea works on any *nix platform.) – abarnert Nov 8 '13 at 20:40