I've found that different pi os' behave better than others, but don't have a solid production-worthy recommendation (yet!)
For the dash soda machine, we're using the latest osmc build. Its kernel seems to have played the nicest with dashd.
(I put dashd on my home osmc/kodi install and let it run for over a week just fine)
When we started getting unexpected dashd crashes (on NOOBS I think), I decided to use osmc as our base image. (quick and dirty, but we needed stability pronto!)
's pi, I installed 'monit' with the following configuration:
sudo apt-get install monit
create file /home/user/.dash/start_dashd.sh
(change user to yours)
/bin/su user -c '/home/user/.dash/dashd 2>&1 >> /home/user/.dash/rc.local.log'
make it executable
chmod 755 /home/user/.dash/start_dashd.sh
sudo edit file /etc/monit/monitrc
# uncomment these lines
set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
# add this to bottom - change user to yours
check process dashd with pidfile /home/user/.dash/dashd.pid
start program = "/home/user/.dash/start_dashd.sh" with timeout 60 seconds
stop program = "/bin/su user -c /home/user/.dash/dash-cli stop"
load the new configuration
enable the watchdog
That's it. You only have to do above once.
Then you can check status by doing
It'll keep your dashd running for you (across reboots too, no need for any crons or scripts) and keep you from fighting with your chosen os.
monit only runs once a minute, so be patient if you're waiting for it to do something.
If you need proof it works, once you see your dashd in the 'sudo monit status' output, you can test it by simply stopping your dashd (dash-cli stop) -- within 2 minutes it'll start it back up.
(But, you don't really need to do that, pi's take between 20 and 40 minutes to completely start up. I recommend leaving it alone once dashd is up and running.)