#! /bin/sh
### BEGIN INIT INFO
# Provides:          origo-api-internal
# Required-Start:    $local_fs $remote_fs $network origo-core
# Required-Stop:     $local_fs $remote_fs $network origo-core
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the origo API node
# Description:       Controls the origo API node which provides
#                    an xmlrpc interface to origo services.
### END INIT INFO

# Author: Patrick Ruckstuhl <patrick@tario.org>
#

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
# $NODE_ID will be filled by the counter between NODE_START and NODE_END
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Origo internal API node"
NAME=origo-api-internal
DAEMON=/usr/local/sbin/origo/origo-api
DAEMON_ARGS="-d -n api-internal\$NODE_ID -p \$((1089+\$NODE_ID)) -internal"
SCRIPTNAME=/etc/init.d/$NAME
WORK_DIR="/var/log/origo/origo-api-internal\$NODE_ID"
PIDFILE="/var/run/origo/api-internal\$NODE_ID.pid"