Pacakge does not create a /var/run/motion directory

Bug #675694 reported by Mike Koss
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
motion (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: motion

Motion requires a /var/run/motion directory to run as a daemon (it stores a motion.pid file there). Without this directory, the daemon will fail to start.

The package should create this directory (chown'ed by 'motion') so user can just set the motion.conf setting for the daemon to run, without having to do additional configuration.

Revision history for this message
Mike Koss (mckoss) wrote :

Since /var/run is getting cleared at boot - I think the correct fix is to change /etc/init.d/motion to create a /var/run/motion
on daemon start. It needs to be writable by the uid 'motion' as well:

...
RUNDIR=/var/run/$NAME
...
case "$1" in
  start)
    if check_daemon_enabled ; then
        log_daemon_msg "Starting $DESC" "$NAME"
        if [ ! -d $RUNDIR ]; then
            mkdir $RUNDIR
            chown root:motion $RUNDIR
            chmod g+w $RUNDIR
        fi
        if start-stop-daemon --start --oknodo --exec $DAEMON -b --chuid motion ; then
            log_end_msg 0
        else
            log_end_msg 1
            RET=1
        fi
    fi
    ;;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.