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
;;
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:
... /var/run/ $NAME enabled ; then
log_daemon_ msg "Starting $DESC" "$NAME"
log_ end_msg 0
log_ end_msg 1
RUNDIR=
...
case "$1" in
start)
if check_daemon_
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
else
RET=1
fi
fi
;;