summaryrefslogtreecommitdiff
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/etc/rc.d/pigallery226
1 files changed, 26 insertions, 0 deletions
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"