mirror of
https://github.com/Motion-Project/motion.git
synced 2026-02-23 01:56:18 -05:00
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:
4
debian/control
vendored
4
debian/control
vendored
@@ -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.
|
||||
|
||||
30
debian/motion.postinst
vendored
30
debian/motion.postinst
vendored
@@ -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#
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user