Tag: swatch/CentOSの自動起動設定
# dnf install swatch
# logfile /var/log/httpd/access.log watchfor /.*/ exec /home/tanaka/bin/myscript.rb '$_'
[Unit] Description=swatch for test log [Service] ExecStart=/usr/bin/swatch -c /etc/swatch.conf -t /var/log/httpd/access.log --pid-file /var/run/swatch.pid --daemo n > /dev/null 2>&1 Type=forking PIDFile=/var/run/swatch.pid [Install] WantedBy=multi-user.target
# systemctl daemon-reload # systemctl enable swatch # systemctl status swatch