CentOS(Scientific) 7でmotionを動かす

調べていたらmotion公式サイトにrpmfusinにあるからそれ使えーって書いてあった。

http://www.lavrsen.dk/foswiki/bin/view/Motion/DownloadFiles

rpmfusion公式からダウンロード

https://rpmfusion.org/Configuration

sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm

リポジトリがデフォルトで無効になるように/etc/yum.repos.d/*.repoを編集する.

enabled=1enables=0へ変更

インストールする.

sudo yum install motion --enablerepo=rpmfusion-free-updates

# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081

# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080

# Restrict stream connections to localhost only (default: on)
stream_localhost off

SELinuxとfirewalldの設定をちゃんとやる.

sudo firewall-cmd --add-port=3300/tcp --zone=public --permanent

[tkoyama@LC-KVM ~]$ sudo systemctl status motion
* motion.service - motion detection system
   Loaded: loaded (/usr/lib/systemd/system/motion.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:motion(1)
           http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

Aug 06 13:42:56 LC-KVM systemd[1]: Started motion detection system.
Aug 06 13:42:56 LC-KVM systemd[1]: Starting motion detection system...
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc....conf
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc....conf
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "sdl_threadnr"
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] motion_startup: Motion 3.3.0 Started
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion.log)
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "sdl_threadnr"
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] motion_startup: Motion 3.3.0 Started
Aug 06 13:42:56 LC-KVM motion[3910]: [0] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion.log)
Hint: Some lines were ellipsized, use -l to show in full.