This question is an exact duplicate of:
- Could not write pid to lock file 2 answers
- I'm relatively new to both raspberry pi and unix.
- In spite of that, I'm teaching intro to programming classes at a school using raspberry pi's.
- These pi's are NOT connected to the internet.
- Each student has a separate account I created for them. The student accounts do not have sudo privileges. Only I do when I log in as pi.
Please note: I have been researching this problem for at least a month. Every proposed solution I have tried has failed.
PROBLEM: Seemingly at random, one of the pi's will stop allowing students or pi to log in from the gui login screen. I can login through tty1, but when I run startx I get an error that says...
FATAL ERROR Could not write pid to lock file in /tmp/.tX1-lock xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error
Attempted solutions that failed:
- Deleting .Xauthority
- Deleting .xsession-errors and/or .xsession-errors.old
- Deleting .tX1-lock
- Deleting .tX0-lock
- Examining various permissions for files on machines that still work and the machine that doesn't (no differences noticed, but I don't really know where to look)
- Running raspi-config in order to expand the file system. Already expanded because the OS was installed with NOOBS.
The ONLY method that has worked has been to back up the student data onto a flash drive and then re-install the operating system using NOOBS. But I have one or two machines failing exactly like this EACH WEEK! Please tell me there is a simpler fix than an OS re-install!