I have some problems with starting Motion software with my Raspberry Pi4 Model B 4 RAM. I have installed motion with comand line : sudo apt-get install motion The motion version is 4.1.1
After I have tried to run motion as a serivce and for this I have modified the daemon configuration in /etc/default/motion where I putted daemon = yes and in /etc/motion/motin.conf where i putted daemon = on.
After I rebooted my Raspberry Pi and if I try to digit: sudo service motion status I always get this message I attached , that said "... permission denied " and then motion never start as a service.
This is the message :
● motion.service - LSB: Start Motion detection
Loaded: loaded (/etc/init.d/motion; generated)
Active: active (exited) since Thu 2021-11-04 16:01:10 CET; 19min ago
Docs: man:systemd-sysv-generator(8)
Process: 409 ExecStart=/etc/init.d/motion start (code=exited, status=0/SUCCESS)
nov 04 16:01:09 raspberrypi systemd[1]: Starting LSB: Start Motion detection...
nov 04 16:01:10 raspberrypi motion[409]: Starting motion detection daemon: motion.
nov 04 16:01:10 raspberrypi systemd[1]: Started LSB: Start Motion detection.
nov 04 16:01:11 raspberrypi motion[494]: [20792968:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
nov 04 16:01:11 raspberrypi motion[494]: [20792968:motion] [NTC] [ALL] motion_startup: Motion 4.1.1 Started
nov 04 16:01:11 raspberrypi motion[494]: [20792968:motion] [ERR] [ALL] myfopen: Error opening file /var/log/motion/motion.log with mode a: Permission denied
nov 04 16:01:11 raspberrypi motion[494]: [20792968:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied
~
I don't understand why I'm getting this message of permission denied. I ask you please if someone could help me, thank you !
After i use the ls -l comand i get this :
pi@raspberrypi:~ $ ls -la /var/log/motion
drwxr-xr-x 2 root root 4096 nov 4 15:28 .
drwxr-xr-x 9 root root 4096 nov 6 15:30 ..
-rw-r--r-- 1 root root 50228 nov 5 17:51 motion.log
pi@raspberrypi:~ $ ls -l /var/log/motion
-rw-r--r-- 1 root root 50228 nov 5 17:51 motion.log
And then
pi@raspberrypi:/var/log/motion $ ls -l motion.log
-rw-r--r-- 1 root root 50228 nov 5 17:51 motion.log
/var/log/motion/
mentioned in the log? Does it exist and what are the permissions for the motion user? Is there a motion.log file in it and is it writable for the motion user?ls -l
? Based on the shown permissions for user/group/other and shown file/dir owner and group you can calculate which permissions apply for themotion
user.