Forums: POPFile 初学者専用 (Thread #13360)

popfileのデーモン化 (2007-01-08 23:23 by Anonymous #26999)

popfileを起動、終了させるシェルスクリプトは
クロスプラットフォームでは、popfile.sh というファイルがインストールされるかと思っていましたが、どうもインストールされないようです。

参考になる起動、終了スクリプトのサンプルコードはないものでしょうか。

Reply to #26999×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: popfileのデーモン化 (2007-01-08 23:31 by amatubu #27001)

Reply to #27001×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: popfileのデーモン化 (2007-01-09 01:28 by Anonymous #27005)

案内いただきましたページを参照しました。Linuxでは、英語の説明でしたので、英語が苦手な我輩では、よく意味がわからなかったというのが正直なところです。サンプルスクリプトで、下記の行をコメントにすると、正常に起動したり、終了したりすることができました。

# Source function library.
if [ -f /etc/init.d/functions ] ; then
/etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
/etc/rc.d/init.d/functions
else
exit 0
fi

あとは、ブートとシャットダウンのときにそれぞれ起動、停止をしたら完成なのですが、そこのところがよくわかりません。

where ?? is a number, e.g. 81, or a high number, but it must not be in use by any of the other scripts (do a ls of the directory and choose a non-used number).
という一文が特によくわからなかったのですが、
これは、K81popfileはrc0.dに、S81popfileはrc3.dに
入れてやればよいという解釈でいいのでしょうか?ちなみに81は未使用です。
"or a high number" とあったので、それ以外でも未使用であれば82とかでもいいということでしょうか?

でも、上記のとおりに設定したのですが、
今度はブートが失敗します。
何か私の解釈が間違えているようです。

いまから、os入れなおします・・・。とほほ・・・
Reply to #27001

Reply to #27005×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: popfileのデーモン化 (2007-01-09 12:43 by amatubu #27016)

スタートアップスクリプトなどのインストール方法は
ディストリビューションによって異なるようですから、
お使いのディストリビューションではどのように設定
するのかをまずお調べください。

参考になるかどうかわかりませんが、私は TeraStation 上で、
http://d.hatena.ne.jp/amatubu/20060621#p1
と設定しています。

以下は、一般的な話として。
K??popfile につける番号は、実行される順序を決める
ためのものですから、起動はできるだけ遅い順番に、
終了はできるだけ早い順番に、と考えればよいと思い
ます。要は、依存するデーモンが先に立ち上がって
いればよいわけです。
うちでは、S96popfile と K25popfile にしています。
Reply to #27005

Reply to #27016×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: popfileのデーモン化 (2007-01-09 23:21 by Anonymous #27020)

なるほど。指南していただいたページを見ると、function 云々のくだりは、省略していいようですね。
とすると、あとは番号の話だけですが81以上?(それとも以下?)の番号をとるようにしなければいけないというのもあまり気にしなくてよいということですか?
non-used number と書いてあったので、未使用番号を使わないといけないということかと思っていました。
where ?? is a number, e.g. 81, or a high number, but it must not be in use by any of the other scripts (do a ls of the directory and choose a non-used number).
とくに、番号は重なっても、必要なサービスがあがった後に起動していればよいし、いち早く終了させるということを考えておけばよいということなんですね。
ひとまず、同じamatubu さんと同じ設定でやってみてみます。
Reply to #27016

Reply to #27020×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: popfileのデーモン化 (2007-01-10 17:46 by amatubu #27046)

私もあまり詳しくはないのですが、function の部分は
ディストリビューション次第なのではないでしょうか。

また、前にも書きましたが、ディストリビューションに
よっては、起動スクリプトのインストール方法が用意
されているものもあるようですので、まずそれを調べ
られるのが先だと思います。
先に紹介したページからリンクされている、SuSE や
Mandrake のページを見ると、それぞれ特別なコマンド
でインストールを行っているように見えます。
このような方法が用意されているのであれば、それを
使うのが一番確実です。

番号については、依存関係がしっかりわかっているので
あれば、最小の番号を選ぶことも可能でしょうが、
わからなければ(起動については)大きめの番号を選んで
おくのがよいのではないでしょうか。
番号が重複しても動くのかどうかはよく知りませんが、
基本的には重複しない番号を選ぶのがよいのではないかと
思います。
Reply to #27020

Reply to #27046×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login