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.
4 Answers 4
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.
-
it doen´t work, ctrl+alt+f4 f5 f6 turns black the screen with ctrl+alt+f1 im returning to the scriptWilty– Wilty2015年06月26日 19:03:56 +00:00Commented Jun 26, 2015 at 19:03
-
@Wilty Added an aleternative to post.joan– joan2015年06月26日 19:21:03 +00:00Commented 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
.PiEnthusiast– PiEnthusiast2015年06月26日 19:48:26 +00:00Commented 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 :SWilty– Wilty2015年06月26日 20:08:01 +00:00Commented 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.joan– joan2015年06月26日 20:32:59 +00:00Commented Jun 26, 2015 at 20:32
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
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.
-
1You mean the magic
sys-req
key?SlySven– SlySven2016年03月18日 18:56:14 +00:00Commented 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 oOBastian35022– Bastian350222016年03月21日 15:20:23 +00:00Commented Mar 21, 2016 at 15:20
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
&
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 avoidrc.local
from being run...