cuspy memo


heart

2007/11/10 Saturday 02:57:44

http://www.erlang.org/doc/man/heart.html
の和訳

モジュール
heart

概要
Erlang ランタイムのハートビート。

詳細
このモジュールは ハートプロセスへのインターフェイスを含みます。ハートは定期的に外部ポートプログラムにハートと呼ばれるハートビートを送ります。このハートポートプログラムの目的はErlangランタイムシステムが監視をし続けているかを確認することです。もしもポートプログラムが HEART_BEAT_TIMEOUT 秒以内(デフォルトで 60秒)にハートビートを受け取らなかった場合、システムは再起動します。
また、システムがハードウェアウォッチドッグタイマーを備え、Solaris で動作している場合、ウォッチドッグは全システムを監視することが出来ます。
Erlang システムをハートプログラムでモニタリングする場合、コマンドラインに -heart フラグを付けなければなりません。(erl(1)を参照)。ハードプロセスは自動的に開始されます。

% erl -heart …

ハートビートを失った場合、Erlang システムは再起動するか、もしくは終了しなければなりません。この環境変数 HEART_COMMAND はシステムが開始される前に設定されなければなりません。もしもこの値が設定されてなければ、警告が表示されシステムは再起動されないでしょう。しかしながらハードウェアウォッチドッグが使用されている場合、HEART_BEAT_BOOT_DELAY秒後(デフォルトで60秒)に再起動を引き起こします。

途中で力尽てしまったorz

  1. Robert wrote related post…

    Silk posts and stories…

    Trackback by Robert wrote related post — 2008/06/19 Thursday @ 17:43:20

Leave a comment

You must be logged in to post a comment.

hoge

erl のオプション -run と -s の違い

2007/11/08 Thursday 23:55:34

erl のオプション -run と -s の違いが解りにくい。
http://www.erlang.org/doc/man/erl.html
にあるドキュメントを読むと

-run Mod [Func [Arg1, Arg2, ...]] (init flag)
Makes init call the specified function. Func defaults to start. If no arguments are provided, the function is assumed to be of arity 0. Otherwise it is assumed to be of arity 1, taking the list [Arg1,Arg2,...] as argument. All arguments are passed as strings. See init(3).

-s Mod [Func [Arg1, Arg2, ...]] (init flag)
Makes init call the specified function. Func defaults to start. If no arguments are provided, the function is assumed to be of arity 0. Otherwise it is assumed to be of arity 1, taking the list [Arg1,Arg2,...] as argument. All arguments are passed as atoms. See init(3).

なんだこの間違い探し。酔っぱらっているので凝視しないと違いが解らなかった。
つまりは、-run は引数が文字列(list) の list の状態で渡されるが、-s は atom の list で渡されるとのこと。
どっちでもいいやって一瞬思ったけどよく考えると -s はオススメ出来ないな。
理由は2つ、erlang の atom には使用できる数に制限があること、もう一つは erlang:list_to_integer/1 はあるけど、 erlang:atom_to_integer/1 は無いこと。

No comments yet.

Leave a comment

You must be logged in to post a comment.

hoge

Problem with Apache 2.2.6(closed)

2007/11/02 Friday 04:39:02

昨日の問題を引き続き調査。

% diff /usr/local/httpd-2.0.61/include/apr.h /usr/local/httpd-2.2.6/include/apr.h
(略)
278c273
< typedef long apr_off_t;
---
> typedef off64_t apr_off_t;
(略)

直接の原因はこれか。やっぱり off64_t が定義されてなかったのかorz
fuse でもこの罠に引っかかってた様な気がする。

/usr/include/unistd.h には

#if defined __USE_XOPEN || defined __USE_XOPEN2K
(略)
# if defined __USE_LARGEFILE64 && !defined __off64_t_defined
typedef __off64_t off64_t;
# define __off64_t_defined
# endif

とあるので CFLAGS に -D__USE_XOPEN -D__USE_LARGEFILE64 など付けてみたんだけどダメだった features.h で undef されてしまう。なんだこりゃ。
結局のところ解決方法は

% ./configure –with-apache=/usr/local/httpd-2.2.6 CFLAGS=”-D_XOPEN_SOURCE -D_LARGEFILE64_SOURCE”

で上手くいった。
apache も少し気をつかって欲しいなと思ったけど glibc も負けずに凶悪だと思った。

No comments yet.

Leave a comment

You must be logged in to post a comment.

hoge

Problem with Apache 2.2.6

2007/11/01 Thursday 04:35:19

apache 2.2.6 で autoconf 化した apache module のビルドが出来ない問題について。
再現方法

% apxs -g -n hello

というように作成した apache module mod_hello を
http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html
の手順に従って autoconf 化する。

% ./configure –with-apache=/usr/local/httpd-2.2.6
% make
/bin/sh ./libtool –tag=CC –mode=compile gcc -DPACKAGE_NAME=\”\” -DPACKAGE_TARNAME=\”\” -DPACKAGE_VERSION=\”\” -DPACKAGE_STRING=\”\” -DPACKAGE_BUGREPORT=\”\” -DPACKAGE=\”mod_hello\” -DVERSION=\”1.0\” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I/usr/local/httpd-2.2.6/include -g -O2 -MT mod_hello.lo -MD -MP -MF .deps/mod_hello.Tpo -c -o mod_hello.lo mod_hello.c
gcc -DPACKAGE_NAME=\”\” -DPACKAGE_TARNAME=\”\” -DPACKAGE_VERSION=\”\” -DPACKAGE_STRING=\”\” -DPACKAGE_BUGREPORT=\”\” -DPACKAGE=\”mod_hello\” -DVERSION=\”1.0\” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I/usr/local/httpd-2.2.6/include -g -O2 -MT mod_hello.lo -MD -MP -MF .deps/mod_hello.Tpo -c mod_hello.c -fPIC -DPIC -o .libs/mod_hello.o
In file included from /usr/local/httpd-2.2.6/include/ap_config.h:25,
from /usr/local/httpd-2.2.6/include/httpd.h:43,
from mod_hello.c:40:
/usr/local/httpd-2.2.6/include/apr.h:273: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’
In file included from /usr/local/httpd-2.2.6/include/apr_file_io.h:29,
from /usr/local/httpd-2.2.6/include/apr_network_io.h:26,
from /usr/local/httpd-2.2.6/include/httpd.h:53,
from mod_hello.c:40:
/usr/local/httpd-2.2.6/include/apr_file_info.h:204: error: expected specifier-qualifier-list before ‘apr_off_t’
In file included from /usr/local/httpd-2.2.6/include/apr_network_io.h:26,
from /usr/local/httpd-2.2.6/include/httpd.h:53,
from mod_hello.c:40:
/usr/local/httpd-2.2.6/include/apr_file_io.h:551: error: expected declaration specifiers or ‘…’ before ‘apr_off_t’
/usr/local/httpd-2.2.6/include/apr_file_io.h:747: error: expected declaration specifiers or ‘…’ before ‘apr_off_t’
In file included from /usr/local/httpd-2.2.6/include/httpd.h:53,
from mod_hello.c:40:
/usr/local/httpd-2.2.6/include/apr_network_io.h:545: error: expected declaration specifiers or ‘…’ before ‘apr_off_t’
In file included from /usr/local/httpd-2.2.6/include/apr_buckets.h:32,
from /usr/local/httpd-2.2.6/include/httpd.h:54,
from mod_hello.c:40:
/usr/local/httpd-2.2.6/include/apr_mmap.h:134: error: expected declaration specifiers or ‘…’ before ‘apr_off_t’
/usr/local/httpd-2.2.6/include/apr_mmap.h:161: error: expected declaration specifiers or ‘…’ before ‘apr_off_t’
In file included from /usr/local/httpd-2.2.6/include/httpd.h:54,
(略)

同様の問題が、
http://www2.ecos.de/~mailarc/embperl/2007-09/msg00007.html
に報告されているが、お前のシステムに off64_t が定義されていないからだという指摘で議論は止まっている。そんな訳ない、off64_t は定義されているし apache 2.0.61 ではなんの問題もなくコンパイル出来る。
恐らく apache 2.2.6 に何らかの問題があるので原因を追っかけたいのだけど、今日はもう眠くて眠くてもうダメだ。

No comments yet.

Leave a comment

You must be logged in to post a comment.

hoge