Page MenuHomeDevCentral

api_exec
No OneTemporary

api_exec

#!/bin/sh
# PROVIDE: api_exec
# REQUIRE: DAEMON
# KEYWORD: shutdown
# -------------------------------------------------------------
# API :: api-exec
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Source file: roles/devserver/api-exec/files/rc/api_exec
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
# api_exec_enable (bool): Set it to YES to enable api_exec.
# Default is "NO"
# api_exec_user (user): Set user to run api_exec
# Default is "nobody".
# api_exec_config (path): The configuration file to use.
# Default is "/usr/local/etc/api-exec.conf".
# api_exec_venv (path): Path to Python virtual environment to use.
# Default is "/srv/api-exec/venv".
# api_exec_logfile (path): Path to the service log.
# Default is "/var/log/api-exec.log".
. /etc/rc.subr
name="api_exec"
rcvar="${name}_enable"
load_rc_config $name
: ${api_exec_enable:="NO"}
: ${api_exec_user:="nobody"}
: ${api_exec_config:="/usr/local/etc/api-exec.conf"}
: ${api_exec_venv:="/srv/api-exec/venv"}
: ${api_exec_logfile:="/var/log/api-exec.log"}
pidfile="/var/run/api-exec.pid"
command="${api_exec_venv}/bin/uwsgi"
command_args="--master --yaml ${api_exec_config} --daemonize2=${api_exec_logfile}"
sig_stop="INT"
start_precmd=api_exec_startprecmd
stop_postcmd=api_exec_stop_postcmd
api_exec_startprecmd()
{
touch ${pidfile} ${api_exec_logfile}
chown ${api_exec_user} ${pidfile} ${api_exec_logfile}
}
api_exec_stop_postcmd()
{
rm -f ${pidfile}
}
run_rc_command "$1"

File Metadata

Mime Type
text/x-shellscript
Expires
Sun, Oct 11, 21:29 (12 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4172736
Default Alt Text
api_exec (1 KB)

Event Timeline