##       activate this where you run autoradiodbusd ##
######################################################

  check process autoradiodbusd with pidfile /var/run/autoradio/autoradiodbus.lock
    start program = "/usr/bin/autoradiodbusd restart"
    stop program  = "/usr/bin/autoradiodbusd stop"
    if failed host autorcf port 1234 then restart

##       activate this where you run jackdaemon     ##
######################################################
#
check process jackdaemon with pidfile /var/run/autoradio/jackdaemon.lock
    start program = "/usr/bin/jackdaemon restart"
    stop program  = "/usr/bin/jackdaemon stop"
    depends on autoradiodbusd


##       activate this where you run autoplayerd ##
###################################################

  check  file autoplayertimestamp with path /home/autoradio/autoplayer.xspf
    if timestamp > 3 minutes then restart


  check process autoplayerd with pidfile /var/run/autoradio/autoplayer.lock
    restart program = "/usr/bin/autoplayerd restart"
    start program = "/usr/bin/autoplayerd start"
    #top program  = "/usr/bin/autoplayerd stop"
    stop program  = "/usr/bin/pkill -x --signal SIGKILL autoplayerd"
    depends on autoplayertimestamp, autoradiodbusd
    depends on autoplayertimestamp, jackdaemon, autoradiodbusd

    if 2 restarts within 3 cycles then exec "/usr/bin/pkill -x --signal SIGKILL autoplayerd"


##       activate this where you run autoradiod ##
##################################################
## Check a file's timestamp. In this example, we test if a file is older
## than 3 minutes and assume something is wrong if its not updated.

  check  file autoradiotimestamp with path /var/run/autoradio/autoradiod.timestamp
    if timestamp > 3 minutes then restart

  check process autoradiod with pidfile /var/run/autoradio/autoradiod.lock
    restart program = "/usr/bin/autoradiod restart"
    start program = "/usr/bin/autoradiod start"
    #stop program  = "/usr/bin/autoradiod stop"
    stop program  = "/usr/bin/pkill -x --signal SIGKILL autoradiod"
    depends on autoradiotimestamp, autoplayerd

    if 2 restarts within 3 cycles then exec "/usr/bin/pkill -x --signal SIGKILL autoradiod"


##       activate this where you run autoradioweb ##
####################################################
## if you use apache you do not need this

#  check process autoradioweb with pidfile /var/run/autoradio/autoradioweb.lock
#    start program = "/usr/bin/autoradioweb restart"
#    stop program  = "/usr/bin/autoradioweb stop"
#    depends on autoplayerd
