Skip to content

Instantly share code, notes, and snippets.

@kyleburton
Created August 26, 2010 14:22
Show Gist options
  • Save kyleburton/551476 to your computer and use it in GitHub Desktop.
Save kyleburton/551476 to your computer and use it in GitHub Desktop.
#!/bin/bash
SVC_HOME="/var/lib/the-clj-service/current"
# no args means we fork
if [ -z "${1:-}" ]; then
export SVC_JAR="$SVC_HOME/the-clj-servicejar"
if [ -z "$SVC_JAR" ]; then
echo "Error: SVC_JAR not found"
exit 1
fi
if [ ! -e $SVC_JAR ]; then
echo "Error: SVC_JAR does not exist! $SVC_JAR"
exit 1
fi
$0 $SVC_JAR &
echo $! > /var/run/the-clj-servicedaemon.pid
exit 0
fi
cd $SVC_HOME
exec java -Xmx256m -cp $SVC_JAR:$SVC_HOME/config service > /var/log/the-clj-service/output.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment