With three identical Raspberry Pi streaming players tootling around the house, it finally dawned on me that they should fetch their Python program directly from The Definitive Source, rather than a local copy.
Tweak the auto-startup in /etc/rc.local
:
mount -o ro mollusk:/mnt/bulkdata/Project\ Files/Streaming\ Media\ Player/Firmware/ /mnt/part sudo -u pi python /mnt/part/Streamer.py &
There’s probably a way to redirect all of the stdout and stderr results to a file for debugging, but the obvious method doesn’t work:
sudo -u pi sh -c "python /mnt/part/Streamer.py 2>&1 > /tmp/st.log" &
That redirects stdout from the subprocess
call to set up the mixer, but doesn’t catch Python’s print
output.
Using the Python logging
library would get most of the way to the goal, although stdout from things like the mixer would still vanish.
Continuing with the network theme, one could netboot the RPi players, but that requires more sysadmin hackery than I’m willing to do, what with the good being the enemy of the best.
Or is it “the best being the enemy of the good”??
Yeah, that.
They’re definitely fighting it out and best ain’t on top right now …
You’re using bash syntax for Bourne shell. Either try using /bin/bash or use “program > file 2>&1”
It’s worse than that; not only does Raspbian / Debian use Dash by default, (I think) WordPress ate a chunk of text in another misguided attempt to (un)escape it.
I re-un-wedged the text, added a note about how it fails, and must beat on this a bit more.
Thanks for the pointer…