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 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?

share|improve this question
 
It is meant to run as a GUI program or in terminal? –  hek2mgl Nov 8 '13 at 20:38
 
How is it going to interact with "the user" if nobody's logged in? There is no user at that point. –  abarnert Nov 8 '13 at 20:39
 
You might want to split it into two parts—a daemon that starts at startup, communicating with a user program that starts at login. (This kind of thing is more common in the Apple world, where you can have system or user "LaunchDaemons" that communicate with user "LaunchAgents" and 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
add comment

1 Answer

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.

share|improve this answer
 
was this answer of any help for your problem? In case you are having problems with any of it, I (or others) could try to help you further –  Erik Jan 14 at 8:45
add comment

Your Answer

 
discard

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.