#!/sbin/openrc-run
  
name=$RC_SVCNAME
cfgfile="/etc/conf.d/$RC_SVCNAME"
pidfile="/var/run/$RC_SVCNAME/$RC_SVCNAME.pid"
command="/usr/share/webapps/$RC_SVCNAME/cps.py"
command_args="-p $CALIBREWEB_DB"
command_user="$CALIBREWEB_USER"
command_group="$CALIBREWEB_GROUP"
start_stop_daemon_args=""
command_background="yes"
output_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log"
error_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.err"

start_pre() {
        checkpath --directory --owner $command_user:$command_group --mode 0775 \
                /var/run/$RC_SVCNAME /var/log/$RC_SVCNAME

		export CALIBREPORT=$CALIBREWEB_PORT
		export CALIBRE_DBPATH=$CALIBREWEB_HOME
}
