2022-10-31 10:41:30 +01:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
# Copyright 2022 Gentoo Authors
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
name="mjolnir daemon"
|
|
|
|
description="mjolnir daemon"
|
|
|
|
command=/usr/bin/node
|
|
|
|
command_args="mjolnir/index.js"
|
|
|
|
command_user="${MJOLNIR_USER:-synapse}"
|
|
|
|
|
|
|
|
supervisor="supervise-daemon"
|
|
|
|
supervise_daemon_args=" -d /opt/mjolnir -e NODE_ENV=\"production\""
|
|
|
|
|
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
|
|
|
local cfg=/opt/mjolnir/config/production.yaml
|
2022-10-31 19:12:13 +01:00
|
|
|
if [[ -f ${cfg} ]]; then
|
|
|
|
echo "${cfg} does not exist or is not a regular file" >&2
|
|
|
|
return 1
|
|
|
|
fi
|
2022-10-31 10:41:30 +01:00
|
|
|
}
|