swatch/CentOSの自動起動設定
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
&tag(swatch/CentOSの自動起動設定);
*目次 [#i30a25d9]
#contents
*関連ページ [#uad411c1]
*参考情報 [#g8f6503a]
-[[[RHEL7/CentOS7] ログ監視ツール swatch を入れてメール通...
*インストール [#eadcd26d]
-CentOS8の場合
# dnf install swatch
*設定 [#x7df8f2e]
**設定ファイルの作成 [#ee3552a0]
-/etc/swatch.confを作成。
#pre{{
# logfile /var/log/httpd/access.log
watchfor /.*/
exec /home/tanaka/bin/myscript.rb '$_'
}}
**自動起動設定 [#f6be3b72]
-/lib/systemd/system/swatch.serviceを作成。
#pre{{
[Unit]
Description=swatch for test log
[Service]
ExecStart=/usr/bin/swatch -c /etc/swatch.conf -t /var/log...
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
終了行:
&tag(swatch/CentOSの自動起動設定);
*目次 [#i30a25d9]
#contents
*関連ページ [#uad411c1]
*参考情報 [#g8f6503a]
-[[[RHEL7/CentOS7] ログ監視ツール swatch を入れてメール通...
*インストール [#eadcd26d]
-CentOS8の場合
# dnf install swatch
*設定 [#x7df8f2e]
**設定ファイルの作成 [#ee3552a0]
-/etc/swatch.confを作成。
#pre{{
# logfile /var/log/httpd/access.log
watchfor /.*/
exec /home/tanaka/bin/myscript.rb '$_'
}}
**自動起動設定 [#f6be3b72]
-/lib/systemd/system/swatch.serviceを作成。
#pre{{
[Unit]
Description=swatch for test log
[Service]
ExecStart=/usr/bin/swatch -c /etc/swatch.conf -t /var/log...
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
ページ名: