alexandros301
Posts: 18
Joined: Thu Jan 22, 2015 9:52 am

editing /etc/rc.local doesn't seem to have any effect

Sat Nov 07, 2015 7:02 pm

Hi,
I want to launch Pure data when the Pi boots, so I've put this line it /etc/rc.local just before 'exit 0'

Code: Select all

sudo -c '/usr/bin/pd -nogui -open /home/pi/pd_patches/theremin.pd &' - pi &
but when the Pi boots Pure Data hasn't launched.
If I type the command within the single brackets in Pi's terminal, all works fine...
BTW, I'm launching Pd as user pi because of a specific object in the Pd patch that doesn't like root...

Thanks

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: editing /etc/rc.local doesn't seem to have any effect

Sat Nov 07, 2015 7:44 pm

If using Jessie and booting into the gui try putting the command in here...


~/.config/lxsession/LXDE-pi/autostart

alexandros301
Posts: 18
Joined: Thu Jan 22, 2015 9:52 am

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 10:48 am

Booting into the GUI? Does this mean logging in with a monitor? No, I want to use it as a musical instrument so I'm using it headless. That's why the Pd launch command includes the -nogui flag.
On other embedded computers, like the Odroid or the Udoo, /etc/rc.local is working as expected with a Debian Jessie image. I just tried the Raspbian Jessie for the first time, on Wheezy it used to work fine. Am I missing something here?

Thanks

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 11:00 am

No, it used to work on wheezy but appears not to work on Jessie which uses systemd

alexandros301
Posts: 18
Joined: Thu Jan 22, 2015 9:52 am

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 5:42 pm

So am I supposed to write a script that will launch Pure Data and then call it from that file like this?

Code: Select all

@sh ${HOME}/my_scripts/lauch_pd.sh
The last line of this file is this

Code: Select all

@sh ${HOME}/.config/lxsession/LXDE-pi/autokey.sh
so I kind of copied it?
Well, actually it doesn't work, I already tried it, so my question is a bit redundant. The real question is, how do I use this file?

Thanks

gkreidl
Posts: 6326
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 6:20 pm

rc.local does work on systemd, but is called at an early time during boot. Some services are not started yet (network, for example) and so some programs won't start,
Put a
sleep 10
(or even more)
before the line with your command.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

alexandros301
Posts: 18
Joined: Thu Jan 22, 2015 9:52 am

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 9:48 pm

sleep doesn't seem to work.
I put a "sleep 30" before the command that launches Pd and it still doesn't work. Any ideas?

danjperron
Posts: 3502
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: editing /etc/rc.local doesn't seem to have any effect

Sun Nov 08, 2015 10:08 pm

Did you try on the crontab

sudo crontab -e

Code: Select all

# m h  dom mon dow   command
@reboot sleep 30 ; /home/pi/my_scripts/lauch_pd.sh

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: editing /etc/rc.local doesn't seem to have any effect

Mon Nov 09, 2015 12:47 am

danjperron wrote: sudo crontab -e
Why does that need to go in root's crontab?

Use just plain
crontab -e
to edit your unprivileged user's crontab.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

alexandros301
Posts: 18
Joined: Thu Jan 22, 2015 9:52 am

Re: editing /etc/rc.local doesn't seem to have any effect

Mon Nov 09, 2015 8:39 am

DougieLawson wrote:
danjperron wrote: sudo crontab -e
Why does that need to go in root's crontab?

Use just plain
crontab -e
to edit your unprivileged user's crontab.
That seemed to do the job, thanks guys!
Since we're at it, does "sudo halt" work as supposed to? I'm logging in via SSH and when I type this command, the connection is being closed, but the ethernet LEDs on the Pi stay on. With Wheezy I remember that the Pi would go completely off with this command...

Thanks

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: editing /etc/rc.local doesn't seem to have any effect

Mon Nov 09, 2015 11:25 am

alexandros301 wrote:Since we're at it, does "sudo halt" work as supposed to? I'm logging in via SSH and when I type this command, the connection is being closed, but the ethernet LEDs on the Pi stay on. With Wheezy I remember that the Pi would go completely off with this command...
Yes, the halt command does work correctly - now. It didn't used to. It was not supposed to shut the system down completely (on a PC it would turn off the power too). It is supposed to just halt the system. This was a long standing bug in Debian.

The command you should use is sudo poweroff, which halts the system and shuts down everything that it is able to.

Return to “Raspberry Pi OS”