diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /media-video/motion/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'media-video/motion/files')
-rw-r--r-- | media-video/motion/files/motion.conf | 1 | ||||
-rw-r--r-- | media-video/motion/files/motion.confd | 4 | ||||
-rw-r--r-- | media-video/motion/files/motion.confd-r1 | 9 | ||||
-rw-r--r-- | media-video/motion/files/motion.initd-r3 | 42 | ||||
-rw-r--r-- | media-video/motion/files/motion.service | 20 | ||||
-rw-r--r-- | media-video/motion/files/motion_at.service | 20 |
6 files changed, 96 insertions, 0 deletions
diff --git a/media-video/motion/files/motion.conf b/media-video/motion/files/motion.conf new file mode 100644 index 000000000000..f032d874f0ca --- /dev/null +++ b/media-video/motion/files/motion.conf @@ -0,0 +1 @@ +d /var/lib/motion/ 0750 motion video diff --git a/media-video/motion/files/motion.confd b/media-video/motion/files/motion.confd new file mode 100644 index 000000000000..f79c97aee968 --- /dev/null +++ b/media-video/motion/files/motion.confd @@ -0,0 +1,4 @@ +# Set the user and group under which motion will be ran + +MOTION_USER="motion" +MOTION_GROUP="video" diff --git a/media-video/motion/files/motion.confd-r1 b/media-video/motion/files/motion.confd-r1 new file mode 100644 index 000000000000..dfff31beb45d --- /dev/null +++ b/media-video/motion/files/motion.confd-r1 @@ -0,0 +1,9 @@ +# Set the user and group under which motion will be run +MOTION_USER="motion" +MOTION_GROUP="video" + +# Set the the directory for storing the pidfile +MOTION_RUN_DIR="/var/run/motion" + +# Set the the working directory for storing images/videos +MOTION_LIB_DIR="/var/lib/motion" diff --git a/media-video/motion/files/motion.initd-r3 b/media-video/motion/files/motion.initd-r3 new file mode 100644 index 000000000000..2b474fc56f9a --- /dev/null +++ b/media-video/motion/files/motion.initd-r3 @@ -0,0 +1,42 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +depend() { + need modules + after mysql +} + +checkconfig() { + export MOTION_RUN_DIR="${MOTION_RUN_DIR:-/var/run/motion}" + checkpath -d -m 750 -o "${MOTION_USER:-motion}:${MOTION_GROUP:-video}" "${MOTION_RUN_DIR}" + export MOTION_LIB_DIR="${MOTION_LIB_DIR:-/var/lib/motion}" + checkpath -d -m 750 -o "${MOTION_USER:-motion}:${MOTION_GROUP:-video}" "${MOTION_LIB_DIR}" + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting motion detection" + start-stop-daemon --start -u "${MOTION_USER}" -g "${MOTION_GROUP}" -d "${MOTION_LIB_DIR}" --quiet --exec /usr/bin/motion -- -b -p "${MOTION_RUN_DIR}/motion.pid" + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping motion detection" + start-stop-daemon --stop --quiet --exec /usr/bin/motion --pidfile "${MOTION_RUN_DIR}/motion.pid" + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading motion detection configuration" + start-stop-daemon --stop --signal HUP --exec /usr/bin/motion --pidfile "${MOTION_RUN_DIR}/motion.pid" + eend $? +} diff --git a/media-video/motion/files/motion.service b/media-video/motion/files/motion.service new file mode 100644 index 000000000000..559b94b6b29a --- /dev/null +++ b/media-video/motion/files/motion.service @@ -0,0 +1,20 @@ +[Unit] +Description=Motion detection daemon +After=local-fs.target network.target +Documentation=man:motion(1) + +[Service] +Type=simple +ExecStart=/usr/bin/motion -n -c /etc/motion/motion.conf +StandardError=null + +User=motion +Group=video + +#RuntimeDirectory=motion +#RuntimeDirectoryMode=0750 + +WorkingDirectory=/var/lib/motion + +[Install] +WantedBy=multi-user.target diff --git a/media-video/motion/files/motion_at.service b/media-video/motion/files/motion_at.service new file mode 100644 index 000000000000..87df91132486 --- /dev/null +++ b/media-video/motion/files/motion_at.service @@ -0,0 +1,20 @@ +[Unit] +Description=Motion detection daemon for %I +After=local-fs.target network.target +Documentation=man:motion(1) + +[Service] +Type=simple +ExecStart=/usr/bin/motion -n -c /etc/motion/motion-%i.conf +StandardError=null + +User=motion +Group=video + +#RuntimeDirectory=motion +#RuntimeDirectoryMode=0750 + +WorkingDirectory=/var/lib/motion + +[Install] +WantedBy=multi-user.target |