summaryrefslogtreecommitdiff
path: root/media-video/unifi-video/files
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/unifi-video/files')
-rw-r--r--media-video/unifi-video/files/commons-daemon-move.patch12
-rw-r--r--media-video/unifi-video/files/mongod-wrapper3
-rw-r--r--media-video/unifi-video/files/unifi-video.initd20
-rw-r--r--media-video/unifi-video/files/unifi-video.service11
4 files changed, 46 insertions, 0 deletions
diff --git a/media-video/unifi-video/files/commons-daemon-move.patch b/media-video/unifi-video/files/commons-daemon-move.patch
new file mode 100644
index 000000000000..448f77249e82
--- /dev/null
+++ b/media-video/unifi-video/files/commons-daemon-move.patch
@@ -0,0 +1,12 @@
+--- a/usr/sbin/unifi-video
++++ b/usr/sbin/unifi-video
+@@ -271,7 +271,7 @@
+ JSVC_OPTS="${JSVC_OPTS} \
+ -user ${PKGUSER} \
+ -home ${JAVA_HOME} \
+- -cp /usr/share/java/commons-daemon.jar:${MAINJAR} \
++ -cp /usr/share/commons-daemon/lib/commons-daemon.jar:${MAINJAR} \
+ -pidfile ${PIDFILE} \
+ -procname ${NAME} \
+ ${JSVC_EXTRA_OPTS} \
+
diff --git a/media-video/unifi-video/files/mongod-wrapper b/media-video/unifi-video/files/mongod-wrapper
new file mode 100644
index 000000000000..f2eb2a437520
--- /dev/null
+++ b/media-video/unifi-video/files/mongod-wrapper
@@ -0,0 +1,3 @@
+#!/bin/bash
+cleaned_args=$(echo $* | sed -e 's/--nohttpinterface//')
+/usr/bin/mongod ${cleaned_args}
diff --git a/media-video/unifi-video/files/unifi-video.initd b/media-video/unifi-video/files/unifi-video.initd
new file mode 100644
index 000000000000..55d6e805453d
--- /dev/null
+++ b/media-video/unifi-video/files/unifi-video.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PID_FILE="/run/unifi-video.pid"
+
+start() {
+ ebegin "Starting unifi-video"
+ start-stop-daemon --start --quiet -b \
+ --pidfile "${PID_FILE}" -m \
+ --exec /usr/sbin/unifi-video start
+ eend $?
+ #--user nobody --group nobody \
+}
+
+stop() {
+ ebegin "Stopping unifi-video"
+ start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
+ eend $?
+}
diff --git a/media-video/unifi-video/files/unifi-video.service b/media-video/unifi-video/files/unifi-video.service
new file mode 100644
index 000000000000..6587be4f1cac
--- /dev/null
+++ b/media-video/unifi-video/files/unifi-video.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=UniFi Video Server
+Requires=network.target
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/unifi-video -D start
+ExecStop=/usr/sbin/unifi-video -D stop
+
+[Install]
+WantedBy=network.target