Page 1 of 1
editing /etc/rc.local doesn't seem to have any effect
Posted: Sat Nov 07, 2015 7:02 pm
by alexandros301
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
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sat Nov 07, 2015 7:44 pm
by gordon77
If using Jessie and booting into the gui try putting the command in here...
~/.config/lxsession/LXDE-pi/autostart
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 10:48 am
by alexandros301
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
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 11:00 am
by gordon77
No, it used to work on wheezy but appears not to work on Jessie which uses systemd
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 5:42 pm
by alexandros301
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
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 6:20 pm
by gkreidl
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.
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 9:48 pm
by alexandros301
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?
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Sun Nov 08, 2015 10:08 pm
by danjperron
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
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Mon Nov 09, 2015 12:47 am
by DougieLawson
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.
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Mon Nov 09, 2015 8:39 am
by alexandros301
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
Re: editing /etc/rc.local doesn't seem to have any effect
Posted: Mon Nov 09, 2015 11:25 am
by rpdom
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.