#!/sbin/openrc-run

name="azure-functions-host"
description="Azure Functions runtime host (Node.js worker)"

command="/opt/startup/start_nonappservice.sh"
command_background="yes"
pidfile="/run/${RC_SVCNAME}.pid"

: ${AzureWebJobsScriptRoot:=/home/site/wwwroot}
: ${FUNCTIONS_WORKER_RUNTIME:=node}

export AzureWebJobsScriptRoot FUNCTIONS_WORKER_RUNTIME

depend() {
        need net
        use dns logger
}

start_pre() {
        checkpath -d -m 0755 -o azurefunc:azurefunc /home/site/wwwroot
}
