dポイントプレゼントキャンペーン実施中!

Windows2003サーバで
月1回以下のような処理をバッチで実行しています(タスクで起動)。
1.apacheのサービスを停止
httpd.exe -k stop -n Apache2 -w
2.apacheのログを退避
MOVE access.log access.log.YYYYMMDD
MOVE error.log error.log.YYYYMMDD
3.apacheのサービス起動
httpd.exe -k start -n Apache2 -w
普段は何も問題なく処理されているのですが、
数ヶ月に1回apacheが起動しない時があります。

ポップアップエラーとして、
***********************************************************
szAppName:httpd.exe szAppVer:2.2.40 szModName:msvcrt.dll
szModVer:703790.3959 offset:00037e23
***********************************************************
上記のようなメッセージが出力されます。

apacheのエラーログ
************************************************************
[Thu Mar 20 02:30:39 2008] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations
[Thu Mar 20 02:30:39 2008] [notice] Server built: Jan 9 2007 23:17:20
[Thu Mar 20 02:30:39 2008] [notice] Parent: Created child process 1700
[Thu Mar 20 02:30:47 2008] [crit] master_main: create child process failed. Exiting.
[Thu Mar 20 02:30:47 2008] [notice] Parent: Forcing termination of child process 36
****************************************************************

Windowsのアプリケーションイベントログ
***************************************************************
2009/04/042:20:08DrWatson情報なし4097N/Aサーバ名アプリケーション C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe がアプリケーション エラーを起こしました。 04/04/2009 02:20:08.578 にエラーが発生しました。 発生した例外: c0000005 アドレス 77B77E23 (msvcrt!memcpy)
2009/04/042:20:08Application Errorエラー(100)1000N/Aサーバ名エラー発生アプリケーション httpd.exe、バージョン 2.2.4.0、エラー発生モジュール msvcrt.dll、バージョン 7.0.3790.3959、エラー発生アドレス 0x00037e23
****************************************************************
何か原因等お分かりになる方はいらっしゃるでしょうか。

PS.あるブログに
mod_perl2とActivePerl build 822を使用するとapacheが起動しない
と記載がありましたが、
自分の環境は必ず起動しないわけではないので、
現象が違うのかな?と考えています。
微妙にoffsetの値も違いました。
ttp://perl.g.hatena.ne.jp/Uchimata/20090325/1237996439
参考↑

A 回答 (1件)

>[crit] master_main: create child process failed. Exiting.


これ、子プロセスが正常起動しなかったって言ってますよね?
Apache2はプロセスが複数できるのはご存知だと思いますが、停止処理の時にそのうちのいくつかが正常終了できていないようですね。

ただ、イベントログのタイムスタンプを見ても、直接関係のあるログなのか良くわかりません。タイムスタンプが全然違いますし・・・

ちなみに、私が扱っているWindows系のサーバではログはrotatelogs.exeを使い、アクセスが殆ど無い深夜にOSごと再起動にしています。(shutdown.exeをタスクスケジューラ起動)

この回答への補足

正しいapacheのerror.logです。
*************************************************************
[Sat Apr 04 02:20:00 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Sat Apr 04 02:20:00 2009] [notice] Child 5688: Exit event signaled. Child process is ending.
[Sat Apr 04 02:20:01 2009] [notice] Child 5688: Released the start mutex
[Sat Apr 04 02:20:02 2009] [notice] Child 5688: Waiting for 250 worker threads to exit.
[Sat Apr 04 02:20:02 2009] [notice] Child 5688: All worker threads have exited.
[Sat Apr 04 02:20:02 2009] [notice] Child 5688: Child process is exiting
[Sat Apr 04 02:20:02 2009] [notice] Parent: Child process exited successfully.
[Sat Apr 04 02:20:05 2009] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations
[Sat Apr 04 02:20:05 2009] [notice] Server built: Jan 9 2007 23:17:20
[Sat Apr 04 02:20:05 2009] [notice] Parent: Created child process 5932
[Sat Apr 04 02:20:10 2009] [crit] master_main: create child process failed. Exiting.
[Sat Apr 04 02:20:10 2009] [notice] Parent: Forcing termination of child process 36
***************************************************************

補足日時:2009/04/14 10:21
    • good
    • 0
この回答へのお礼

ご解答ありがとうございます。
イベントログのタイムスタンプは申し訳ございません、別の日付のものをUPしていました。apacheのエラーと同じ時間に、同じエラーメッセージが出力されています。
今手元のログが無いので、再度UPさせて頂きます。
rotatelogs.exeも当初考えたのですが、
実はバッチファイルの中で、DBのログ退避とバックアップ。
apacheとDBのログの削除等他の処理も行っています。
子プロセスがうまく停止できなかったということは、
WEBサービスにアクセスがあったからなのでしょうか?
たしかにapacheの停止⇒起動の時間の前に、
画面にアクセスしているユーザがいました。
夜中の2時なのに・・・。
やはりマシンの再起動を行うのが確実なんでしょうか・・・。
マシンの再起動を検討してみます。

お礼日時:2009/04/13 17:47

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!