motioneye log file issue

Hello! I am so glad to see motioneye included and working once again, so I decided to reinstall it. I got this warning:

cannot create log file /var/log/motion/motion.log: Permission denied

However when I check, I only have a

/var/log/motioneye/

directory and not

/motion

Is this because I still have leftovers from the previous motioneye install? When I type

systemctl restart moti

and press tab here, I see

motion.service motioneye.service

as options. Does this mean my leftover from previous install is still haunting my system? How do I proceed from here?

Looks like there are leftovers from the motioneye installation.
Create a folder motion inside /var/log/ and give rights to motion user to write there.

I am so glad to see motioneye included and working once again

Thanks to the volunteers who have taken over the entire project from original maintainer and did the migration to Python3. This way we where able to re-add MotionEye again. Keep in mind that the Paython3 version is still has BETA status. Issues regarding the new version would need to be reported to the new project team https://github.com/motioneye-project/motioneye/issues

Back to your issue: I did a test and the directory should be /var/log/motioneye/

root@DietPi3:~# ls -la /var/log/motioneye/
total 0
drwxr-xr-x 2 motion motion  40 Apr  9 20:34 .
drwxr-xr-x 5 root   root   220 Apr  9 20:34 ..
root@DietPi3:~#

Looks like you still have some leftover from the past. Maybe an old config file?

It does seem to be leftovers

# whereis motion
motion: /usr/bin/motion /etc/motion /usr/share/man/man1/motion.1.gz

Is there a manner in which I can safely remove the old motion since the new one is under motioneye? I don’t really have a use for the old files, and I have no problem reconfiguring the new one as I didn’t really have much configured in the older one anyway, just one camera. I did remove the old motion via dietpi-software uninstall quite a while back but these were somehow still left behind (seems the old binary is still there too?) I suppose the configs were retained for safekeeping? This is still in /usr/bin:

-rwxr-xr-x 1 root root      378448 Nov 16  2020  motion

on my test system I see both directories

root@DietPi3:~# ls -la /etc | grep motion
drwxr-xr-x  2 root   root    4096 Apr  9 20:34 motion
drwxr-xr-x  2 motion motion  4096 Apr  9 20:34 motioneye
root@DietPi3:~#

As well I have both service definition

root@DietPi3:~# systemctl cat motion
# /lib/systemd/system/motion.service
[Unit]
Description=Motion detection video capture daemon
Documentation=man:motion(1)

[Service]
Type=simple
User=motion
ExecStart=/usr/bin/motion

[Install]
WantedBy=multi-user.target



root@DietPi3:~# systemctl cat motioneye
# /etc/systemd/system/motioneye.service
[Unit]
Description=motionEye Server
After=network.target

[Service]
User=motion
RuntimeDirectory=motioneye
LogsDirectory=motioneye
StateDirectory=motioneye
ExecStart=/usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
Restart=on-abort

[Install]
WantedBy=multi-user.target
root@DietPi3:~#

But motion service is disabled

root@DietPi3:~# systemctl status motion
● motion.service - Motion detection video capture daemon
     Loaded: loaded (/lib/systemd/system/motion.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:motion(1)
root@DietPi3:~#

how does yours looks like?

Sorry for the late reply. motion is disabled from what I see.

# ls -la /etc | grep motion
drwxr-xr-x   2 root   root    4096 Apr  8 22:28 motion
drwxr-xr-x   2 motion motion  4096 Apr  8 22:29 motioneye

# systemctl cat motion
# /lib/systemd/system/motion.service
[Unit]
Description=Motion detection video capture daemon
Documentation=man:motion(1)

[Service]
Type=simple
User=motion
ExecStart=/usr/bin/motion

[Install]
WantedBy=multi-user.target

# systemctl cat motioneye
# /etc/systemd/system/motioneye.service
[Unit]
Description=motionEye Server
After=network.target

[Service]
User=motion
RuntimeDirectory=motioneye
LogsDirectory=motioneye
StateDirectory=motioneye
ExecStart=/usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf
Restart=on-abort

[Install]
WantedBy=multi-user.target

Oops, forgot to include this:

# systemctl status motion
● motion.service - Motion detection video capture daemon
     Loaded: loaded (/lib/systemd/system/motion.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:motion(1)

Apr 08 22:29:05 poopypi systemd[1]: Started Motion detection video capture daemon.
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [ERR] [ALL] create_path: Problem creating directory /var/log/motion: Permission denied
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [ERR] [ALL] create_path: Problem creating directory /var/log/motion: Permission denied
Apr 08 22:29:06 poopypi motion[53289]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied
Apr 08 22:29:08 poopypi systemd[1]: motion.service: Succeeded.
Apr 08 22:29:08 poopypi systemd[1]: motion.service: Consumed 1.334s CPU time.

motion is disabled from what I see.

not really. At least the service was active at Apr 08 22:29.

Did you tried a reboot and checked if the motion.service tried to start again?

I just rebooted and rechecked with this:

# systemctl status motion
● motion.service - Motion detection video capture daemon
     Loaded: loaded (/lib/systemd/system/motion.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:motion(1)

Should be ok as is like this?

to double check

journalctl -u motion
# journalctl -u motion
-- Journal begins at Mon 2022-03-21 03:55:29 +08, ends at Mon 2022-04-11 18:59:01 +08. --
-- No entries --

seems to be fine now

Alright, I shall leave it as is, thanks again!