Update debian files: Create user/group motion , create pid directory and set motion permissions , add chuid to init script and change default pid path in motion-dist.conf

This commit is contained in:
AngelCarpintero
2007-09-01 01:21:29 +00:00
parent 45869a6d1e
commit 04a967494f
4 changed files with 36 additions and 6 deletions

4
debian/control vendored
View File

@@ -9,7 +9,7 @@ Package: motion
Architecture: any
Depends: ${shlibs:Depends}
Recommends: ffmpeg
Suggests: mysql-client, postgresql-client
Suggests: mysql-client, postgresql-client, mjpegtools
Description: V4L capture program supporting motion detection
Motion is a program that monitors the video signal from
one or more cameras and is able to detect if a significant
@@ -23,7 +23,7 @@ Description: V4L capture program supporting motion detection
The output from motion can be:
- jpg files
- ppm format files
- mpeg video sequences
- mpeg, avi, swf video sequences
.
Also, motion has its own minimalistic web server. Thus,
you can access the webcam output from motion via a browser.

View File

@@ -6,6 +6,36 @@ set -e
. /usr/share/debconf/confmodule
add_group_if_missing() {
if [ -x /usr/sbin/adduser ]; then
if ! id -g motion >/dev/null 2>&1; then
addgroup --force-badname motion
fi
fi
}
add_user_if_missing() {
if [ -x /usr/sbin/adduser ]; then
if ! id -u motion > /dev/null 2>&1; then
adduser --system --no-create-home \
--disabled-password --force-badname \
motion
fi
fi
}
create_pid_dir(){
if ! [ -d /var/run/motion ]; then
mkdir /var/run/motion
fi
chown motion:motion /var/run/motion
}
add_group_if_missing
add_user_if_missing
create_pid_dir
db_stop
#DEBHELPER#

View File

@@ -11,7 +11,7 @@
daemon on
# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion.pid
process_id_file /var/run/motion/motion.pid
############################################################
# Basic Setup Mode

View File

@@ -6,7 +6,7 @@
NAME=motion
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=@BIN_PATH@/motion
PIDFILE=/var/run/$NAME.pid
PIDFILE=/var/run/motion/$NAME.pid
trap "" 1
@@ -19,7 +19,7 @@ test -f $DAEMON || exit 0
case "$1" in
start)
echo "Starting motion detection : $NAME"
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --chuid motion
;;
stop)
@@ -45,7 +45,7 @@ case "$1" in
restart-motion)
echo "Restarting $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec $DAEMON --retry 30
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --chuid motion
;;
restart)