summaryrefslogtreecommitdiff
path: root/science/orthanc/files/orthanc.in
diff options
context:
space:
mode:
Diffstat (limited to 'science/orthanc/files/orthanc.in')
-rw-r--r--science/orthanc/files/orthanc.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/science/orthanc/files/orthanc.in b/science/orthanc/files/orthanc.in
new file mode 100644
index 000000000000..3dcf4cd38fe0
--- /dev/null
+++ b/science/orthanc/files/orthanc.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: orthanc
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# orthanc_enable (bool): Set to NO by default.
+# Set it to YES to enable Orthanc.
+# orthanc_flags (str): Set to %%ETCDIR%%/orthanc.json
+# by default.
+
+. /etc/rc.subr
+
+name=orthanc
+rcvar=orthanc_enable
+desc="RESTful DICOM server for healthcare and medical research"
+
+load_rc_config $name
+
+: ${orthanc_enable:=NO}
+: ${orthanc_flags="%%ETCDIR%%/orthanc.json"}
+
+start_precmd=orthanc_prestart
+pidfile=/var/run/orthanc.pid
+procname=%%PREFIX%%/sbin/Orthanc
+command=/usr/sbin/daemon
+command_args=" -f -p ${pidfile} -u orthanc ${procname} ${orthanc_flags}"
+
+orthanc_prestart()
+{
+ # Have to empty rc_flags so they don't get passed to daemon(8)
+ rc_flags=""
+}
+
+run_rc_command "$1"