コピーした設定ファイルにアクセスするようにMotionを設定するにはどうすればよいですか?

コピーした設定ファイルにアクセスするようにMotionを設定するにはどうすればよいですか?

提案通りこのチュートリアルモーション設定ファイルを ~/.motion/motion.conf の下のデフォルトフォルダにコピーしました。ただし、Motionはまだ/etc/motion/motion.confの下の設定ファイルにアクセスしようとしています。この問題をどのように解決できますか?

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

-cオプションを使用すると、Motionに他の設定ファイルを使用するように指示できます。たとえば、いくつかの変更を行う場合は、通常、Motion.conf ファイルをコピーして名前を test.motion.conf と指定し、次のように使用します。

モーション-c /home/b/motion/test.motion.conf

開発者のWebサイトでコマンドラインオプションの詳細を確認できます。 ~のためコマンドラインオプションここをクリック

編集する:

Motion用のホームサーバーに異常な変更を加えた可能性があります。だからテストしてノートパソコンにインストールしてみました。

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
...

あなたの構成がどのように見えるかわかりません。たぶんデーモンモードで実行しようとしているかもしれません。または、ファイルをコピーしても、ルートが所有者として割り当てられている可能性があります。実行してみて、/var/log/syslogを調べてエラーの原因を確認できます。または、次にユーザーを追加してみることもできます。スポーツグループ。

おすすめ記事