LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 11-23-2021, 02:43 PM   #1
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
motion install on raspberry pi Raspberry Pi Model B Rev 2: logging issue; howto solve?


Hello,
since my raspberry SD boot card was dead, I am reinstalling raspbian on it for making running the home observation video again.
So far achieved:
- raspberry reachable via ssh
- motion installed

uname -r
Code:
5.10.63+
parameter in /etc/motion/motion.conf
..
log_file /var/log/motion/motion.log
..

now..
sudo service motion restart
Code:
Message from syslogd@raspcamera at Nov 23 21:29:02 ...
 motion[928]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied

Broadcast message from systemd-journald@raspcamera (Tue 2021-11-23 21:29:02 CET):

motion[928]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied
following did not help:
(file created with
sudo mkdir motion
sudo chown root:motion motion
sudo touch /var/log/motion/motion.log
sudo chown root:motion /var/log/motion/motion.log
)

sudo chmod 666 /var/log/motion/motion.log
sudo ls -l /var/log/motion/motion.log

Code:
-rw-rw-rw- 1 root motion 0 23. Nov 21:19 /var/log/motion/motion.log
Any suggestion/advice/comment is welcome.

Last edited by floppy_stuttgart; 11-23-2021 at 02:44 PM.
 
Old 11-24-2021, 04:21 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,359

Rep: Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333
Quote:
Originally Posted by floppy_stuttgart
cannot create log file /var/log/motion/motion.log: Permission denied
Just looking at the error, something is wrong with the permissions. The 'sudo' should overcome it, but obviously is not doing it. The first thing I'd try is
Code:
sudo chmod 4755 /path/to/motion_executable
Also, I'd run a check on the log file.
 
Old 11-24-2021, 05:33 AM   #3
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
first: done. issue still there. See at bottom.

second: "I'd run a check on the log file." this?..
sudo ls -l /var/log/motion/motion.log
Code:
-rw-rw-rw- 1 motion motion 0 23. Nov 21:19 /var/log/motion/motion.log

sudo ls -l /bin/motion
-rwxr-xr-x 1 root root 315668 15. Nov 2020 /bin/motion
sudo chmod 4755 /bin/motion
sudo ls -l /bin/motion
-rwsr-xr-x 1 root root 315668 15. Nov 2020 /bin/motion

sudo service motion restart

Code:
Message from syslogd@raspcamera at Nov 24 12:29:50 ...
 motion[1782]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied

Broadcast message from systemd-journald@raspcamera (Wed 2021-11-24 12:29:50 CET):

motion[1782]: [0:motion] [EMG] [ALL] motion_startup: Exit motion, cannot create log file /var/log/motion/motion.log: Permission denied
 
Old 11-24-2021, 08:53 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,359

Rep: Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333
You don't need me to say, but that all looks good.

Code:
sudo service motion restart
That's a systemd script, at a guess. Better grok that.

I'd also touch the log file, or otherwise write to it, to check that's possible. lastly, have you just run the moition file directly?

Last edited by business_kid; 11-24-2021 at 08:56 AM.
 
Old 11-24-2021, 09:47 AM   #5
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
error gone after
Quote:
sudo mkdir /tmp/motion
sudo chown motion:motion /tmp/motion
sudo touch /tmp/motion/motion.log
sudo chown motion:motion /tmp/motion/motion.log
and putting "log_file /tmp/motion/motion.log" in
Quote:
/etc/motion/motion.conf
Quote:
sudo service motion restart
 
Old 11-24-2021, 10:34 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,359

Rep: Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333Reputation: 2333
Motion must be dropping it's privileges. Glad you sorted it. Mark this solved.
 
Old 11-24-2021, 11:06 AM   #7
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by floppy_stuttgart View Post
error gone after

and putting "log_file /tmp/motion/motion.log" in
Depending on how your distro handles the /tmp that has the possibility of disappearing on reboot, if it cleans the /tmp by default. Since you mention Pi that is most likely Debian based and that definitely cleans it, I always put my temporary stuff there I care little about sticking around on the system if I forget to delete them, just so they will be deleted.

https://serverfault.com/questions/37...mp-get-cleared
 
Old 02-27-2024, 10:09 PM   #8
jeffsrey
LQ Newbie
 
Registered: Feb 2024
Posts: 1

Rep: Reputation: 0
Success!

Thank you, this worked perfectly for me. I created an account as a result.
 
  


Reply

Tags
motion, raspbian



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Raspberry Pi Model B Rev 2 with camera module; HowTo setup in motion? floppy_stuttgart Linux - Embedded & Single-board computer 1 12-31-2020 10:05 AM
LXer: Cities In Motion & Cities In Motion 2 Released For Linux On Steam LXer Syndicated Linux News 0 01-09-2014 08:32 PM
Motion help please (Motion only supports mmap) ?? RaeMarvin Linux - Software 4 09-06-2012 12:25 PM
Why and What is the best" Motion" or "ZoneMinder" for motion detection? MODYSAMA Linux - Newbie 3 07-06-2011 07:16 PM
Error with "SDL_MouseMotionEvent *motion = event->motion;" aatwell Programming 3 11-30-2007 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration