0

I'm using a new Raspberry Pi model B+ (with Raspbian) in order to host my Django website but I have an issue when I try to go to repositories.

My website is well-hosted, I can access through http://astrophoto-val.fr to my website, but I can't access to directories inside my raspberry. I'm not connected with SSH (it doesn't work) but directly over my device.

I have this loop :

enter image description here

I can't write something. How can I stop all of this and access to ID/Password area in order to handle files in /var/www/html ?

I don't want to reset my SD Card :/

Thank you!

EDIT :

This is what I've done on cmdline.txt :

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=fd6771a8-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait systemd.unit=emergency.target

But I don't overcome, when I start my raspberry, to get access to login part. I have the loop shown on my picture and I can't make more things. Even if I use Ctrl + Alt + F2

7
  • Did you set Django to run in your rc.local? If so, you should probably see autostarting program with rc.local, stuck on startup if you haven't explicitly set it to run in the background.
    – Aurora0001
    Commented Jul 29, 2018 at 17:14
  • I don't know what is rc.local exactly. So I have never used this before. When my raspbian is launched (like my picture) I can't write something. Even if I use Ctrl + Alt + F2 for example :/
    – Essex
    Commented Jul 29, 2018 at 17:24
  • I don't know what is rc.local exactly. So I have never used this before do you know what you put in it? it looks like it's trying to establish some sort of SSH connection with 67.197.150.242 - does that mean anything to you? Commented Jul 29, 2018 at 23:49
  • I'd be concerned about whatever you added to rc.local adding a chinese and taiwanese IP addresse to the "list of known hosts" Commented Jul 29, 2018 at 23:58
  • Please edit your question and add the content of your cmdline.txt to it.
    – Ingo
    Commented Jul 30, 2018 at 6:27

1 Answer 1

2

On a linux system with card reader you can mount the SD Card partition 2 and modify the files you want, also etc/rc.local and files in var/www/html.

You can also boot into rescue.target. Mount partition 1 an append this to cmdline.txt:

systemd.unit=rescue.target

Boot your RasPi with this and you should get a terminal and you can repair your system on the command line. If it doesn't help instead you can try to append to cmdline.txt:

systemd.unit=emergency.target

This will give you only a shell on the main console without running any other services. But maybe it's enough to fix your problem. Quoted from Special systemd units

emergency.target: A special target unit that starts an emergency shell on the main console. This target does not pull in any services or mounts. It is the most minimal version of starting the system in order to acquire an interactive shell; the only processes running are usually just the system manager (PID 1) and the shell process.

If you don't even get access with this target then it seems you are lost.

4
  • Thank you with your answer. But I modified my file .txt as you mentioned and I can't get any terminal in order to repair my system. I still remain blocked to rc.local : lost connection .... Like my picture ... Is it possible that my raspbian is corrupted by somebody ?
    – Essex
    Commented Jul 29, 2018 at 16:54
  • I have updated my answer. Don't modify myfile.txt, it must be the file cmdline.txt. Be careful and don't add extra space or new lines in it. You can also modify /var/www/html if partition 2 is mounted on a linux pc with a card reader.
    – Ingo
    Commented Jul 29, 2018 at 18:24
  • my file .txt is the shortcut of cmdline.txt ^^ I can't get access to /var/www/html because I can't get access to login part in first time ..
    – Essex
    Commented Jul 29, 2018 at 19:45
  • @Deadpool - you must've done something wrong™ - did you add systemd.unit=rescue.target on the first (and only) line in cmdline.txt on the boot partition of the sd card you boot the raspberry pi with? Commented Jul 29, 2018 at 23:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.