diff --git a/debian/control b/debian/control index 91087687..525b1f9b 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/debian/motion.postinst b/debian/motion.postinst index 7e9f57f8..4ac7f4da 100644 --- a/debian/motion.postinst +++ b/debian/motion.postinst @@ -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# diff --git a/motion-dist.conf b/motion-dist.conf index a3f6d88e..0ddb355a 100644 --- a/motion-dist.conf +++ b/motion-dist.conf @@ -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 diff --git a/motion.init-Debian.in b/motion.init-Debian.in index 41be2be3..fbca5a52 100644 --- a/motion.init-Debian.in +++ b/motion.init-Debian.in @@ -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)