summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-05-19 18:50:35 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-05-19 18:50:35 +0000
commitec2def758c9e9236a158af7861cbf500ff34cebb (patch)
tree34fba94c923ae814b305ee522704cc16ae6ce627 /media-video/motion/files
parentAdd perl-5.14.0 as provider. Change version scheme. Force stable keywords (diff)
downloadgentoo-2-ec2def758c9e9236a158af7861cbf500ff34cebb.tar.gz
gentoo-2-ec2def758c9e9236a158af7861cbf500ff34cebb.tar.bz2
gentoo-2-ec2def758c9e9236a158af7861cbf500ff34cebb.zip
Version bump. Create /var/run/motion from init script instead of ebuild wrt #332633. Don't (temporarily) enable v4l if linux-headers >= 2.6.38 wrt #361509. Use virtual/ffmpeg wrt #362145.
(Portage version: 2.2.0_alpha33/cvs/Linux x86_64)
Diffstat (limited to 'media-video/motion/files')
-rw-r--r--media-video/motion/files/motion.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/media-video/motion/files/motion.initd b/media-video/motion/files/motion.initd
new file mode 100644
index 000000000000..de13ed9243e6
--- /dev/null
+++ b/media-video/motion/files/motion.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/motion/files/motion.initd,v 1.1 2011/05/19 18:50:35 ssuominen Exp $
+
+opts="${opts} reload"
+
+_create_motion_run_dir() {
+ local dir="/var/run/motion"
+ if ! [ -d "$dir" ]; then
+ mkdir -p -m750 "$dir"
+ chown ${MOTION_USER}:${MOTION_GROUP} "$dir"
+ fi
+}
+
+depend() {
+ need modules
+ after mysql
+}
+
+start() {
+ _create_motion_run_dir
+
+ ebegin "Starting motion detection"
+ start-stop-daemon --start -c ${MOTION_USER} -g ${MOTION_GROUP} --quiet --exec /usr/bin/motion
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping motion detection"
+ start-stop-daemon --stop --quiet --exec /usr/bin/motion
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading motion detection configuration"
+ start-stop-daemon --stop --signal HUP --exec /usr/bin/motion
+ eend $?
+}