|
|||||||||
inotify の変更点
* inotify [#q94b1f5f]
※ 概要~
ファイルの更新をチェックし、何らかのアクションを起こすデーモン~
keyword: ディレクトリ監視~
* install [#q9bdd5d7]
yum -y inotify-tools
*** /usr/local/bin/inotifywrapper [#b8e2dbea]
そのままでは使いにくいのでラッパーを作る
#pre{{
#!/bin/bash
/usr/bin/inotifywait -q -e close_write $1
$2
}}
*** /etc/inittab に登録 [#u456c2a9]
in:2345:respawn:/usr/local/bin/inotifywrapper filename exe.pl
* 保険 [#uef3662b]
*** cron [#zf015b8d]
よく落ちることがあるので cron でチェックしてます...~
意味ないじゃん...
#pre{{
#!/usr/bin/perl
$inotify = `ps auwx |grep inotifywrapper |grep -v grep |wc -l`;
if ($inotify!=1){
system("/sbin/init q");
}
}}
|
|||||||||