Comment 1 for bug 675694

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
    ;;