Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cron error (grandchild #xxxxx failed with exit status 1)

1,253 views
Skip to first unread message

MorimotoTatsuhiro

unread,
May 14, 2010, 10:15:27 AM5/14/10
to
森元と申します。
squeezeです。

cronを3.0pl1-109から3.0pl1-110へapt-get upgradeしてからsyslogに以下のエ
ラーが出るようになり、cronからメールが送られてくるようになりました。

userでfetchmailで10分間隔で問い合わせをさせています。

****************************************
crontab -e

# m h dom mon dow command
*/10 * * * * fetchmail -a -s > /dev/null 2>&1
*******************************************

以下syslog(一例)です。

May 14 22:40:01 kurobox-pro /USR/SBIN/CRON[12349]: (fatboy) CMD
(fetchmail -a -s > /dev/null 2>&1)
May 14 22:40:13 kurobox-pro /USR/SBIN/CRON[12348]: (CRON) error
(grandchild #12349 failed with exit status 1)

上記のようにfetchmailをcronで実行したあと必ずこの2行目ようなエラーが付い
て来て、エラーメールが送られ来るようになりました。(10分おきに)

とりあえず、MAILTO=""を加えてメールが送信されてくるのは止めてはいます。

対処の方法をご存知方、よろしくお願いします。


Hideki Yamane

unread,
May 14, 2010, 10:35:24 AM5/14/10
to
On Fri, 14 May 2010 23:15:27 +0900
MorimotoTatsuhiro <fat...@morimoto.dyndns.org> wrote:
> cronを3.0pl1-109から3.0pl1-110へapt-get upgradeしてからsyslogに以下のエ
> ラーが出るようになり、cronからメールが送られてくるようになりました。

 /usr/share/doc/cron/NEWS.Debian.gz より
 
cron (3.0pl1-110) unstable; urgency=low

In the past, long-running jobs caused certain MTAs to time out,
resulting in no output being sent. Justin Pryzby's patch to fix this
has been included. It may be worth to note that Debian's default MTA
exim was not susceptible to this.

Tasks generating a lot of output no longer die with when no MTA is
installed.

crontab(1) now refuses any crontabs missing a newline before EOF. In
the past, this has been the source of much confusion -- especially
because the upstream code supposed to detect this was severely broken.


 NEWS.Debian を見逃さないためには apt-listchanges をインストールしておくと
 良いでしょう。


--
Regards,

Hideki Yamane henrich @ debian.or.jp/org
http://wiki.debian.org/HidekiYamane

MorimotoTatsuhiro

unread,
May 14, 2010, 8:05:56 PM5/14/10
to
Hideki Yamane さんは書きました:
Yamane様ありがとうございます。

実はわたくしも
zcat /usr/share/doc/NEWS.Debian.gzでこの文章を見てはいましたが、恥ずかし
ながら私の英語力では理解が出来ませんでした。

申し訳ありませんが、日本語でアドバイスしていただけないでしょうか。

Morimoto


YAMASHITA Junji , 山下 純司

unread,
May 14, 2010, 8:58:35 PM5/14/10
to
山下です。

On Fri, 14 May 2010 23:15:27 +0900,
<fat...@morimoto.dyndns.org> wrote:
>
> May 14 22:40:01 kurobox-pro /USR/SBIN/CRON[12349]: (fatboy) CMD (fetchmail -a -s > /dev/null 2>&1)
> May 14 22:40:13 kurobox-pro /USR/SBIN/CRON[12348]: (CRON) error (grandchild #12349 failed with exit status 1)
>
> 上記のようにfetchmailをcronで実行したあと必ずこの2行目ようなエラーが付い
> て来て、エラーメールが送られ来るようになりました。(10分おきに)

2行目の failed with exit status 1 を問題視してい
ますか。

man:fetchmail(1)

終了コード

1 There was no mail awaiting retrieval. (There may
have been old mail still on the server but not
selected for retrieval.) If you do not want "no
mail" to be an error condition (for instance, for
cron jobs), use a POSIX-com‐pliant shell and add

|| [ $? -eq 1 ]

to the end of the fetchmail command line, note that
this leaves 0 untouched, maps 1 to 0, and maps all
other codes to 1. See also item #C8 in the FAQ.


(原文では)親切なことに対応方法まで説明されていま
す。


エラーメールが送られてくるようになった切っ掛けが
cron パッケージの更新とのことですが、更新前は送ら
れていなかったとしたら、むしろそちらの方が不思議
です。

以上
--
山下 純司 mailto:ysi...@gmail.com

Takashi Masuda , 増田貴士

unread,
May 15, 2010, 12:42:44 AM5/15/10
to
増田です。
私も squeeze です。

On Fri, 14 May 2010 23:15:27 +0900

MorimotoTatsuhiro <fat...@morimoto.dyndns.org> wrote:

> userでfetchmailで10分間隔で問い合わせをさせています。
>
> ****************************************
> crontab -e
>
> # m h dom mon dow command
> */10 * * * * fetchmail -a -s > /dev/null 2>&1
> *******************************************

daemon モードでの起動じゃダメですかね?
ログイン後に以下のコマンドを実行すれば、10 分おきに POP サーバへの問い
合わせを行ってくれます。

% fetchmail --daemon 600

-a オプションは ~/.fetchmailrc に fetchall を追記することで
代替になると思います。

あと、fetchmail は POP サーバがずっと落ちていると、諦めて終了するような
ので、私は以下のスクリプトのログイン時の自動実行と、10 分間隔で実行する
ような cron への登録をしています。

----------------------------------------------------------------------
#!/bin/sh

if ! ps auxc | grep -e "^$LOGNAME.* fetchmail$" > /dev/null; then
fetchmail --daemon 90
fi
----------------------------------------------------------------------

--
Takashi Masuda <masu...@nifty.com>

Hideki Yamane

unread,
May 15, 2010, 2:05:22 AM5/15/10
to
On Sat, 15 May 2010 09:05:56 +0900
MorimotoTatsuhiro <fat...@morimoto.dyndns.org> wrote:
> 申し訳ありませんが、日本語でアドバイスしていただけないでしょうか。

 あぁ、山下さんの指摘を確認された方がよろしいですね、私のは cron の
 バージョンアップ、というところしか見ていませんでした。

 新しいメールがないのをエラーじゃないと考える場合は || [ $? -eq 1 ] と
 シェルスクリプトの最後に付記せよ、で対応できるのではないでしょうか。

MorimotoTatsuhiro

unread,
May 16, 2010, 11:55:13 AM5/16/10
to
> 1 There was no mail awaiting retrieval. (There may
> have been old mail still on the server but not
> selected for retrieval.) If you do not want "no
> mail" to be an error condition (for instance, for
> cron jobs), use a POSIX-com‐pliant shell and add
>
> || [ $? -eq 1 ]
>
> to the end of the fetchmail command line, note that
> this leaves 0 untouched, maps 1 to 0, and maps all
> other codes to 1. See also item #C8 in the FAQ.


アドバイスいただいたように、|| [ $? -eq 1 ]を付ける事で希望の挙動になっ
てくれました。

ご指摘のように、これを付けなくてもアップデート前はエラーメールは来なかっ
た理由はまだ解りません。cronやfetchmailの設定ファイルを再度見直して見た
いと思います。

「解決」とさせて頂きます。
皆様どうもありがとうございました。

Morimoto

0 new messages