Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-video/motion/files: motion.initd
Date: Thu, 19 May 2011 18:51:25
Message-Id: 20110519185035.A7C0E20057@flycatcher.gentoo.org
1 ssuominen 11/05/19 18:50:35
2
3 Added: motion.initd
4 Log:
5 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.
6
7 (Portage version: 2.2.0_alpha33/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-video/motion/files/motion.initd
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/motion/files/motion.initd?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/motion/files/motion.initd?rev=1.1&content-type=text/plain
14
15 Index: motion.initd
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2011 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/media-video/motion/files/motion.initd,v 1.1 2011/05/19 18:50:35 ssuominen Exp $
21
22 opts="${opts} reload"
23
24 _create_motion_run_dir() {
25 local dir="/var/run/motion"
26 if ! [ -d "$dir" ]; then
27 mkdir -p -m750 "$dir"
28 chown ${MOTION_USER}:${MOTION_GROUP} "$dir"
29 fi
30 }
31
32 depend() {
33 need modules
34 after mysql
35 }
36
37 start() {
38 _create_motion_run_dir
39
40 ebegin "Starting motion detection"
41 start-stop-daemon --start -c ${MOTION_USER} -g ${MOTION_GROUP} --quiet --exec /usr/bin/motion
42 eend $?
43 }
44
45 stop() {
46 ebegin "Stopping motion detection"
47 start-stop-daemon --stop --quiet --exec /usr/bin/motion
48 eend $?
49 }
50
51 reload() {
52 ebegin "Reloading motion detection configuration"
53 start-stop-daemon --stop --signal HUP --exec /usr/bin/motion
54 eend $?
55 }