plamoni/SiriProxy — Issue #137: SiriProxy as background service
Author: dcinzona
Created: 2011-12-04 18:40:52+00:00
State: open

Hey,
I'm trying to get SiriProxy to run as a background service on my Synology DiskStation.
I was able to get it all set up so that I can run it manually form SSH. I also have the script working in the startup and Synology packages section... the problem is, I can see the process start and then stop after a second.
I can confirm that I am running it as root and the script itself works (when I run the launch script manually, it works fine).

I'm starting to wonder if it has to do with Ruby and logging to the console (since it runs in the background, there's no console to log to I would imagine)

Either way, this is REALLY freaking cool and I'm so close! I dont want to have to keep an SSH session open every time I want siriproxy running (which is: eternally).

In case you want to know, this is the script that currently (and successfully when run from SSH manually) starts SiriProxy:
Also, just of note - i set the sudo option to NOPASSWD specifically for the script so it will run without prompting for password

======================================
#!/bin/sh

PKGNAME="siriproxy"
PKGPATH="/var/packages/"${PKGNAME}

SPBIN=${PKGNAME}

SPSTART=sudo /opt/bin/siriproxy server

case $1 in
start)
echo "Starting SiriProxy ..."
${SPSTART}
exit 0
;;
stop)
echo "Stopping SiriProxy ..."
killall ${SPBIN}
exit 0
;;
status)
ps | grep -v grep | grep /opt/bin/siriproxy > /dev/null
if [ $? -ne 0 ]; then
echo "Status: SiriProxy is not running"
exit 1
fi
echo "Status: SiriProxy is running"
exit 0
;;
esac
======================================