From 9413b45124dc947c6c1437fb5aa6e144cd075366 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 18 Jul 2020 15:01:55 -0400 Subject: [PATCH] bin: Add first take at OpenBSD rc.d init script I'm not convinced using shell redirects / backgrounding (&) is the proper way to daemonize this process / capture logs. Ideally the webserver would be able to do both itself. However, as a checkpoint, this is a functional rc.d script to start/stop/check the server. --- bin/euchre-service.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bin/euchre-service.sh diff --git a/bin/euchre-service.sh b/bin/euchre-service.sh new file mode 100644 index 0000000..fe9e33f --- /dev/null +++ b/bin/euchre-service.sh @@ -0,0 +1,17 @@ +#!/bin/ksh +# OpenBSD rc.d service for euchre.live + +# config +INSTALL="/home/_euchre/prod-el" +# end config + +daemon="$INSTALL/gloat.pl daemon -m production" +daemon_flags=">> /var/log/gloat/prod.log 2>&1 &" +daemon_user="_euchre" + +. /etc/rc.d/rc.subr + +# use pexp because the redirections in the flags won't show up in pgrep +pexp="perl $daemon" + +rc_cmd "$1" -- libgit2 1.1.1