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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-23-2021, 02:43 PM
|
#1
|
Senior Member
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,181
Rep: 
|
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
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.
|
|
|
11-24-2021, 04:21 AM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,413
|
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.
|
|
|
11-24-2021, 05:33 AM
|
#3
|
Senior Member
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,181
Original Poster
Rep: 
|
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
|
|
|
11-24-2021, 08:53 AM
|
#4
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,413
|
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.
|
|
|
11-24-2021, 09:47 AM
|
#5
|
Senior Member
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,181
Original Poster
Rep: 
|
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:
sudo service motion restart
|
|
|
|
11-24-2021, 10:34 AM
|
#6
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,413
|
Motion must be dropping it's privileges. Glad you sorted it. Mark this solved.
|
|
|
11-24-2021, 11:06 AM
|
#7
|
Senior Member
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170
|
Quote:
Originally Posted by floppy_stuttgart
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
|
|
|
02-27-2024, 10:09 PM
|
#8
|
LQ Newbie
Registered: Feb 2024
Posts: 1
Rep:
|
Success!
Thank you, this worked perfectly for me. I created an account as a result.
|
|
|
01-04-2025, 09:28 AM
|
#9
|
LQ Newbie
Registered: Oct 2020
Posts: 13
Rep: 
|
Same problem
Thankyou had the same problem. follwed the answer and worked perfectly first time
|
|
|
All times are GMT -5. The time now is 12:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|