plamoni/SiriProxy — Issue #191: Auto restart Siriproxy after a crash
Author: mtrayn01
Created: 2011-12-14 00:55:23+00:00
State: open

Hi guys,

I'm having a problem when trying to script Siriproxy to auto restart in the event of a crash. I'm running SiriProxy on Ubuntu 11.10

I have a bash script which checks if Siriproxy is running or not, and if not, starts it up. The script works fine when run manually.

I want to add this as a cronjob running as the root user to eliminate the need for inputting a password when running siriproxy server command.

My problem is whenever I add the script to the crontab, it fails to start siriproxy. The script I am using is pasted below.

Can anyone offer any suggestions on how to make this work?

#!/bin/bash
ps -ef | grep -q '[s]iriproxy'
if [ $? -ne 0 ]
then
echo "SiriProxy is down, trying to start it..."
cd /home/nas/SiriProxy
./siriproxy server $
else
echo "SiriProxy is already running, no action required"
date
fi

I also tried specifying the full path to the siriproxy command (after copying it from the bin directory to the main SiriProxy directory) "/home/nas/SiriProxy/siriproxy server $" but this did not work either.