0

I have a Raspberry Pi and I picked up a tft touch screen from adafruit to play around with. In order to get it working I've had to run a few lines from from rc.local including startx which for some reason has logged me in as root@raspberrypi once the OS on the touchscreen starts working.

Once the OS is running on the touch screen, I need to run two programs, matchbox-keyboard and pianobar both of which run just fine by typing in "matchbox-keyboard", and "pianobar" from the LXTerminal.

However, if I try to add "matchbox-keyboard" or "pianobar" to rc.local under either the root rc.local or pi rc.local the programs will not run.

I tried to get around this by adding a file, keyboard.sh which I have given permissions to (chmod u+rwx keyboard.sh) to my desktop which has the lines:

#!bash
matchbox-keyboard
pianobar

The file is there, and when clicked asks me to either execute, or execute in terminal, both of which do not work.

I'm stumped. Anyone have any Ideas?

2
  • I assume you cannot run X applications from the rc.local while X is not running. Those applications need X running before they can start. Commented Dec 24, 2013 at 11:06
  • Add the full path to those programs into the *.rc file, i.e. /path/to/pianobar, or update your PATH variable to include the correct path? Also running them in the background as mentioned below may help. Good luck. Commented Dec 24, 2013 at 16:54

1 Answer 1

1

I'm not sure how Debian is organized, but if rc.local is a file under /etc/rc.d the system will automatically run any commands from this file at the end of system initialization, so just filling the rc.local file with this would be enough (I'm supposing matchbox-keyboard is blocking, that's why I'm starting it on the background with the &):

matchbox-keyboard &
pianobar

Just the fact you have a keyboard.sh file at the /etc/rc.d dir doesn't mean it will get executed, even if it has +x permission. The file rc.local with exec permission, on the other hand, gets executed because it is run from /etc/rc.d/rc.M (I suppose it is like this on any Linux which uses BSD-style init scripts, like Slackware, for example).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.