Skip to content

Instantly share code, notes, and snippets.

@alealexpro100
Created June 20, 2022 11:02
Show Gist options
  • Save alealexpro100/14e845f5f77b5e0d9da107b640cc72d6 to your computer and use it in GitHub Desktop.
Save alealexpro100/14e845f5f77b5e0d9da107b640cc72d6 to your computer and use it in GitHub Desktop.
MeshCentral OpenRC service using mariadb
#!/sbin/openrc-run
name="mesh"
description="meshcentral service"
command="/usr/bin/node /home/$name/node_modules/meshcentral"
command_background="yes"
user="$name"
group="$user"
depend() {
need net localmount mariadb
after firewall
}
start() {
ebegin "Starting ${name}"
export NODE_ENV=production
start-stop-daemon --exec ${command} \
--background \
-k 0002 \
-u ${user} -g ${group} \
--start -- ${command_args}
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment