[PD] autoboot in Linux - solution
Sukandar Kartadinata
sk at glui.de
Fri Oct 15 03:56:21 CEST 2004
> Great, would you mind telling us exactly what you did? One should
> always explain the solution if one is found for the benefit of others
> who may be dealing with the same problem. Also, tell us what distro
> this is on.
OK, here's my report on what I had to do to get autoboot working. Hope
it'll help other linux newbies at some point....
System:
Asus Digimatrix
Fedora Core 1 with PlanetCCRMA mods
I started with a script to start pd with all required libraries and my
main patch:
-- pd_start:
#! /bin/sh
# chkconfig: 2345 98 98
# description: starts pd
echo -n "starting pd..."
/usr/bin/pd -nogui -nomidi \
-lib /usr/lib/pd/extra/OSC \
-lib /usr/lib/pd/extra/zexy \
/home/glui/proj/LIDARmacher/pd/GPlayerStereo.pd &
--
I put that into /etc/init.d/ and ran chkconfig to add it to the list of
things to start:
chkconfig --add pd_start
however, this didn't work - pd just didn't show up in the process list
(ps -A)
I had thought that by starting pd_start as the last script (by giving
it the highest number - 98 in the second line of the script) things
would behave the same way as if I had run the script right after login.
Looking at /var/log/messages proved that pd had been started as the
last item.
Then I tried to debug things a bit by adding the 'ps -A' command to the
script. Instead of getting a clean list of all processes I got it
interweaved with all sorts of audio related error messages. So
apparently pd was getting started to early, but I had no idea how to
delay it.
Here's where Pall Thayer's suggestion was promising - by adding
pd_start's commands to /etc/rc.d/rc.local these should be executed
after everything else.
-- rc.local:
#!/bin/sh
echo -n "starting pd..."
/usr/bin/pd -verbose -nogui -nomidi
-lib /usr/lib/pd/extra/OSC \
-lib /usr/lib/pd/extra/zexy \
/home/glui/proj/LIDARmacher/pd/GPlayerStereo.pd &
--
(then chkconfig --del pd_start to avoid starting things twice)
This still didn't get it working though - the system would hang right
after echoing "starting pd..."
So then I tried CK's suggestion to put the actual pd call into another
script inside /usr/local/bin/ along with the proper environment,
calling it from a /etc/init.d script (check his email)
However, this only worked after I called this from rc.local (so that's
what I meant when I said that a combination of the two suggestions did
it)
Here's the final scripts:
-- /etc/rc.d/rc.local:
#!/bin/sh
echo -n "starting pd..."
PATH=/sbin:/bin:/usr/sbin:/usr/bin
/usr/local/bin/pd_start
--
-- /usr/local/bin/pd_start:
#! /bin/sh
echo -n "starting pd..."
PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin
cd /home/glui
pd -verbose -nogui -nomidi \
-lib /usr/lib/pd/extra/OSC \
-lib /usr/lib/pd/extra/zexy \
-open /home/glui/proj/LIDARmacher/pd/GPlayerStereo.pd &
--
hope that explains the process - let me know if there's still things
unclear
More information about the Pd-list
mailing list