3

As suggested in this tutorial I made a copy of the Motion configuration file in my home folder under ~/.motion/motion.conf . But Motion then still tries to access the config-file under /etc/motion/motion.conf . How do I fix this behaviour?

Here is what I get when I start Motion:

nuc@nuc:~$ motion
[0] **could not open configfile /etc/motion/motion.conf: Permission denied**
[0] Not config file to process using default values
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3547904 LIBAVFORMAT_BUILD 3544067
[1] Thread 1 started
[1] Failed to open video device /dev/video0: No such file or directory
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video0: No such file or directory
1

You can tell Motion to use a different config file using the -c option. For example, if I am working on some changes I will usually make a copy of my motion.conf file, named test.motion.conf, and use it with the following command:

motion -c /home/b/motion/test.motion.conf

You can find out more information about the command line options on the developer's website. For the command line options click here.

Edit:

It is possible I have made some unusual changes on the server at home I use for Motion. So, as a test I just installed it on my laptop.

sudo apt-get install motion
mkdir /home/b/scripts/motion
sudo cp /etc/motion/motion.conf /home/b/scripts/motion/test.motion.conf
sudo chown b:b /home/b/scripts/motion/test.motion.conf


$ motion -c /home/b/scripts/motion/test.motion.conf
[0] Processing thread 0 - config file /home/b/scripts/motion/test.motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3547904 LIBAVFORMAT_BUILD 3544067
[0] Thread 1 is from /home/b/scripts/motion/test.motion.conf
[1] Thread 1 started
...

I am not sure what your configuration looks like. Maybe you are trying to run it in daemon mode. Or, if you copied the file it may still have root designated as the owner. You can try running it then looking at /var/log/syslog to get an idea of what is causing the error. Or, you could try adding your user to the motion group.

|improve this answer|||||
  • Thanks. I wonder if this is the only way, as the tutorial I linked to totally omits this. – empedokles Aug 25 '14 at 18:10
  • @brwfx Strange I get 'motion -c ~/.motion/motion.conf [0] Configfile /home/nuc/.motion/motion.conf not found - trying defaults.: Permission denied' but if I put a sudo before motion it works. Is this normal? – empedokles Aug 25 '14 at 18:23
  • "Invalid netcam_url (rtsp://192.168.1.199:554/ISAPI/streaming/channels/101)" Do you see anything suspicious? – empedokles Aug 25 '14 at 18:28
  • Did you have to use the -c paramenter? Because the tutorial above doesn't presuppose it. – empedokles Aug 26 '14 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.