hewesy
Posts: 7
Joined: Mon May 12, 2014 11:41 am
Location: Bucks, UK

Script in RC.Local issues

Sun May 24, 2015 3:50 pm

Hi all,

I have built my Pi into a wildlife/moment sensor camera and wanted the scrip to auto run so I could drop it in place, power up and walk away (it runs via a 12vDC battery to run the Pi and an IR LED light array).

I have added the script to RC.Local using python /home/pi/script.py &

It works perfectly - too perfectly as I cannot stop it to enable the Pi to be booted into either command line or GUI !!

Now I have edited this, how can I remove or stop the process? I can see rc.local via WinSCP and can open it but cannot edit (I presume as it is in use?).

Any ideas please?

User avatar
jojopi
Posts: 3274
Joined: Tue Oct 11, 2011 8:38 pm

Re: Script in RC.Local issues

Sun May 24, 2015 9:09 pm

hewesy wrote:I can see rc.local via WinSCP and can open it but cannot edit (I presume as it is in use?).
I think you cannot edit /etc/rc.local because you are connected as user pi, not root. Try to rename /home/pi/script.py to something else instead. Otherwise install PuTTY alongside WinSCP on the PC and you will be able to log in and run commands (including sudo) rather than only upload files.

Did you really include the "&" on the command in rc.local? If the script is running in the background it should not be blocking the rest of the boot.

hewesy
Posts: 7
Joined: Mon May 12, 2014 11:41 am
Location: Bucks, UK

Re: Script in RC.Local issues

Mon May 25, 2015 7:13 pm

Thanks jojopi, PuTTY installed and rc.local edited.

I did add an &, I've now removed it and will see if that means I can cease the script with ctrl+c.

Thanks again,

Return to “Troubleshooting”