Page 1 of 1

RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 6:43 pm
by leeqicheng
Hey guys i know there have been lots of thread on this but i just couldnt figure out whats the problem because i did a clean install and i have the rc.load.error. Anybody having the issue and whats the work around trying to run a python or a shell script

raspberry pi v 2 1.1

Image

Thanks
LEE QICHENG

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 6:47 pm
by DougieLawson
What happens if you open a LXterminal window and run sudo /etc/rc.local or sudo bash -x /etc/rc.local to get lots of debugging messages?

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 6:54 pm
by leeqicheng
DougieLawson wrote:
Sat Oct 28, 2017 6:47 pm
What happens if you open a LXterminal window and run sudo /etc/rc.local or sudo bash -x /etc/rc.local to get lots of debugging messages?
i gotten no such file found or directory but i have it

Image


If i run sudo /etc/rc.local
Image

if i run sudo bash -x /ect ...
Image

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 7:00 pm
by DougieLawson
There's your error on line #23.

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 7:04 pm
by leeqicheng
DougieLawson wrote:
Sat Oct 28, 2017 7:00 pm
There's your error on line #23.
I dun think i have written anything on line 23 please enlighten me thanks

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 7:08 pm
by DougieLawson
Look at the output from running sudo bash -x /etc/rc.local again in detail.

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 7:09 pm
by rpdom
You've been using a windows editor or something. It has changed the line endings from just a newline (NL = "\n") to CRNL ("\r\n") instead.

Try stripping out the unwanted CR characters. You can do this by installing the dos2unix package and running

Code: Select all

sudo dos2unix /etc/rc.local
or use something like sed to edit it

Code: Select all

sudo sed -i "s/\r//" /etc/rc.local

Re: RPI 2 RC.local issue

Posted: Sat Oct 28, 2017 7:16 pm
by leeqicheng
rpdom wrote:
Sat Oct 28, 2017 7:09 pm
You've been using a windows editor or something. It has changed the line endings from just a newline (NL = "\n") to CRNL ("\r\n") instead.

Try stripping out the unwanted CR characters. You can do this by installing the dos2unix package and running

Code: Select all

sudo dos2unix /etc/rc.local
or use something like sed to edit it

Code: Select all

sudo sed -i "s/\r//" /etc/rc.local
Yup that fix my problems thanks i will learn from this and keep this in mine thanks man