diff options
author | Adam T. Carpenter <atc@53hor.net> | 2022-11-28 22:21:50 -0500 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2022-11-28 22:21:50 -0500 |
commit | 17ec35eb7c5d1d3d4e0fc389aed03695328ace21 (patch) | |
tree | 9ee1ceda07c743314f4e458c27eb1f94e7f3cca1 /usr/local/etc | |
download | pigallery2-17ec35eb7c5d1d3d4e0fc389aed03695328ace21.tar.xz pigallery2-17ec35eb7c5d1d3d4e0fc389aed03695328ace21.zip |
feat: add template and startup service
Diffstat (limited to 'usr/local/etc')
-rwxr-xr-x | usr/local/etc/rc.d/pigallery2 | 26 |
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" |