1

I edited the /etc/rc.local to run a python script. It works, but it never ends, I tried Ctrl+c but it does not work I can't get in to the log in / password display.

dhruvvyas90
2,8833 gold badges21 silver badges33 bronze badges
asked Jun 26, 2015 at 16:41
1
  • That would be because you forgot the trailing & to run the python script in the background whilst the rest of the /etc/rc.local was run and then exited wouldn't it? 8-) Most of the answers that I can see below seem to think that /etc/rc.local has finished (so that then the RPi proceeds to complete multi-user start-up) - but you need to avoid rc.local from being run... Commented Mar 18, 2016 at 18:50

4 Answers 4

1

Try ctrl+alt+f1 to get a console window (ctrl+alt+f7 to return).

You can login and edit/kill the script and reboot.

Search for password recovery.

Alternatively edit cmdline.txt (it's on a FAT partition so is visible on a Windows machine) and add init=/bin/sh to the end of the (single) line. Reboot and edit rc.local then undo the change to cmdline.txt and reboot again.

answered Jun 26, 2015 at 17:31
5
  • it doen´t work, ctrl+alt+f4 f5 f6 turns black the screen with ctrl+alt+f1 im returning to the script Commented Jun 26, 2015 at 19:03
  • @Wilty Added an aleternative to post. Commented Jun 26, 2015 at 19:21
  • Also, once you get to a regular state again, make sure the last line in /etc/rc.local is exit 0. Commented Jun 26, 2015 at 19:48
  • i also try with the cmdline stuff with the recover because, i didnt see the cmdline.txt on windows :S Commented Jun 26, 2015 at 20:08
  • @Wilty If you are using NOOBS you'll need to google a bit more. I don't know what to do when using NOOBS. Commented Jun 26, 2015 at 20:32
1

If all fails:

a) If you are using NOOBS hold shift at startup and you can restore

b) Plug the card into an alternate computer, pull off the files you want, and wipe/reinstall

answered Oct 25, 2015 at 1:15
1

When booting to CLI, alt+print+k seems to work. This kills all processes running in the current terminal, from what i read. You get to the CLI then, and can modify rc.local.

answered Mar 18, 2016 at 11:47
2
  • 1
    You mean the magic sys-req key? Commented Mar 18, 2016 at 18:56
  • Thanks for the link for background info =) Didn't know this key combination is part of a whole set oO Commented Mar 21, 2016 at 15:20
0

try putting a background process in rc.local

!/usr/bin/sh
runMyScript() {
 python PATH/TO/SCRIPT/script.py &
}
runMyScript

Next time you reboot your Pi you will get your login again

answered Mar 18, 2016 at 13:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.