### Package specific variables and functions
# Base service USER to run background process prefixed according to DSM
USER="root"
PRIV_PREFIX=sc-
SYNOUSER_PREFIX=svc-
if [ -n "${SYNOPKG_DSM_VERSION_MAJOR}" -a "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 6 ]; then EFF_USER="${SYNOUSER_PREFIX}${USER}"; else EFF_USER="${PRIV_PREFIX}${USER}"; fi
# start-stop-status script redirect stdout/stderr to LOG_FILE
LOG_FILE="${SYNOPKG_PKGDEST}/var/${SYNOPKG_PKGNAME}.log"
# Service command has to deliver its pid into PID_FILE
PID_FILE="${SYNOPKG_PKGDEST}/var/${SYNOPKG_PKGNAME}.pid"

# Invoke shell function if available
call_func ()
{
    FUNC=$1
    if type "$FUNC" | grep -q 'function' 2>/dev/null; then
        if [ -n "${INST_LOG}" ]; then
            echo "Invoke $FUNC" >> ${INST_LOG}
        fi
        eval ${FUNC}
    fi
}

