I have installed the motion package on my pi (stretch). If I start motion in the foreground it's working but when I try to start it as a daemon it fails with the following log message:
motion: permission denied for /var/log/motion/motion.log
I've seen many approaches to fix this problem by tinkering with the permissions of /var/log/... but this does not convince me.
Q What's the correct way to fix this problem?
Update
I've motion installed as a service and I start it for testing with
sudo service motion start
but even then it fails with the error message below
raspberrypi motion[323]: [0:motion] [ERR] [ALL] myfopen: Error opening file /var/log/motion/motion.log with mode a: Permission denied
After removing the
– jontsai Oct 20 '18 at 03:05/var/log/motion
directory, restart the service usingsudo service motion restart
and it works correctly.sudo service motion restart
– NickG Apr 08 '22 at 08:40/var/log/motion
(i.e.sudo rm -r /var/log/motion
) at first and then reboot. – participant Apr 19 '22 at 15:40