edited with some success.
Situation: I have Control4 and FreeNAS and all my music (years working in music industry yields > 25k songs).
Problem: FreeNAS deprecated Samba1 and although it's possible to tunable it back, I loathe buggy, unsecure, deprecated code. Enter the world of DLNA. With Control4 you can on demand from a lot of DLNA servers; however, to program a song to play thru DLNA in a room at a certain time/situation, they currently use a search command for album and Plex does not allow searching in DLNA. Hence moved to miniDLNA in a jail. miniDLNA is not great for large collections such as my own and it drops fairly regularly.
Solution: In the miniDLNA jail cron is already there so crontab -e to enter * * * * /script.sh to run that script each minute. Code the script to the tune of
Code:
UP=$(/usr/local/etc/rc.d/minidlna status | grep "is running" | grep -v not | wc -l);
if [ "$UP" -ne 1 ];
then
echo "service miniDLNA is down";
service minidlna start
else
echo "service miniDLNA is running already";
fi
And you can check each minute to see if miniDLNA is down in rc.d and restart it.