ARMTC Forum

Full Version: RPi2TC startup issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I need to autostart a program during boot. I have scripts that run after X has started and when root and these work perfectly in standard Raspian image but don't with the RPi2TC image. The scripts have been stripped to a minimum for clarity.

In /etc/X11/Xsession.d/ there is 95LMSS:

Code:
#!/bin/bash
### BEGIN INIT INFO
# Provides:          LMSS
# Required-Start:    
# Required-Stop:
# Default-Start:     5
# Default-Stop:
# Short-Description: Run LINUX Mouse Switching
### END INIT INFO

echo "Start 95LMSS" >$HOME/LMSSlog.txt
sudo /usr/bin/RunLMSS
echo "End 95LMSS" >>$HOME/LMSSlog.txt

and in /usr/bin/ there is RunLMSS:
Code:
#!/bin/bash
#
#
#
echo "In RunLMSS - Start " >>$HOME/LMSSlog.txt
echo "Hello"
sudo /usr/bin/LMSS >>LMSSlog.txt &
echo "After LMSS" >>$HOME/LMSSlog.txt
echo "RunLMSS about to exit 0" >>$HOME/LMSSlog.txt
exit 0

Starting RPi2TC displays video and then 'blank' screen. If I open another console (Ctrl+Alt+F2) and type 'startx' everything works perfectly. If I look at the log files they are:

root - LMSSlog.txt:
Quote:Start 95LMSS
In RunLMSS - Start
After LMSS
RunLMSS about to exit 0
End 95LMSS

rpitc - LMSSlog.txt:
Quote:Start 95LMSS

Any thoughts as to why the second script is not being called?

David
Please verify that RunLMSS is having sufficient rights. (as example "chmod 777" and "chmod + x" )
Can you run RunLMSS manually?
Ok I commented out
sudo /usr/bin/RunLMSS
and it now goes to desktop
opening terminal and typing
sudo /usr/bin/RunLMSS
works perfectly - I forgot to mention I had already done this.

Could it be sudo causing the issue?

David
I was right.... edit sudoers to include:

rpitc ALL=(ALL) NOPASSWD: ALL

resolves the issue.

David
Hello,

I had also similar type of problem in my project. Then i prefer best raspberry pi books for solution, i think you also prefer this for quick solution.

Thanks