From 17ec35eb7c5d1d3d4e0fc389aed03695328ace21 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Mon, 28 Nov 2022 22:21:50 -0500 Subject: feat: add template and startup service --- usr/local/etc/rc.d/pigallery2 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 usr/local/etc/rc.d/pigallery2 (limited to 'usr') diff --git a/usr/local/etc/rc.d/pigallery2 b/usr/local/etc/rc.d/pigallery2 new file mode 100755 index 0000000..daed768 --- /dev/null +++ b/usr/local/etc/rc.d/pigallery2 @@ -0,0 +1,26 @@ +#!/bin/sh +# PROVIDE: pigallery2 +# REQUIRE: DAEMON NETWORKING +# KEYWORD: shutdown + +. /etc/rc.subr + +name="pigallery2" +rcvar="${name}_enable" +pigallery2_chdir="/usr/local/www/pigallery2" +pidfile="/var/run/${name}.pid" +node="/usr/local/bin/node" +command="/usr/sbin/daemon" +procname="daemon" +load_rc_config $name +#: ${pigallery2_config="/var/pigallery2/config.json"} +script_js="/usr/local/www/pigallery2/src/backend/index.js" +script_opts="--config-path ${pigallery2_config}" +command_args="-o /var/log/${name}.log -c -f -P ${pidfile} ${node} ${script_js} ${script_opts}" +start_precmd="${name}_precmd" + +pigallery2_precmd() { + install /dev/null ${pidfile} +} + +run_rc_command "$1" -- cgit v1.2.3