dnf-automaticがIniParser Illegal continuation line XXを吐いて失敗する

1年程dnf-automaticがかからないサーバーがあり、原因を探ってもこれまて特定出来なかった。
仕方なくsudo dnf updateで手動更新を続けてきたが、claude.mytosによる脆弱性大量発見の煽りで毎日のようにupdateが続いている状況でこれはマズいと思い徹底的に調べてみた。
/etc/dnf/automatic.confでは[command]でpython製の自作sendmailツールを呼んで更新通知を配信する設定になっている。
dnf-automatic.timerももちろんちゃんとインストール、00:06:00にタイマーセットしてある。
sudo systemctl cat dnf-automatic.timer
[Timer] OnCalendar=*-*-* 6:00
RandomizedDelaySec=60m
Persistent=true
dnf-automaticがちゃんと発火してるか確認すると本日も6:19にちゃんと発火していた。
sudo systemctl show dnf-automatic.timer \
-p LastTriggerUSec \
-p NextElapseUSecRealtime
NextElapseUSecRealtime=Fri 2026-07-03 06:50:57 JST
LastTriggerUSec=Thu 2026-07-02 06:19:36 JST
なのにdnf-automaticは実行されず、更新通知メールは届いていない。
タイマー使わず手作業でdnf-automaticを呼んでみる。
sudo systemctl start dnf-automatic.service
Job for dnf-automatic.service failed because the control process exited with error code.
See “systemctl status dnf-automatic.service” and “journalctl -xeu dnf-automatic.service” for details.
なんと即死状態。タイマーはちゃんとautomaticを発火させていたのだが、肝心のautomaticは即死していたので自動アップデートがかからなかったのだ。
一体何が原因で即死しているのか?
sudo journalctl -xeu dnf-automatic.service
7月 02 16:47:09 hogeserver systemd[1]: Starting dnf automatic…
░░ Subject: A start job for unit dnf-automatic.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.cybertrust.co.jp/miracle-linux/
░░
░░ A start job for unit dnf-automatic.service has begun execution.
░░
░░ The job identifier is 4308. 7月 02 16:47:09 hogeserver dnf-automatic[4298]: エラー: Parsing file “/etc/dnf/automatic.conf” failed: Parsing file ‘/etc/dnf/automatic.conf’ failed: IniParser: Illegal continuation line at line 80
IniParser: Illegal continuation line at line 80とでている。
/etc/dnf/automatic.confの80行目でIniParserが転けてる(INI構文が壊れている)ようだ。
/etc/dnf/automatic.conf
76 [command_email]
77 # The shell command to use to send email. This is a Python format string,
78 # as used in str.format(). The format function will pass shell-quoted arguments
79 # called body, subject, email_from, email_to.
80 command_format = “mail -Ssendwait -s {subject} -r {email_from} {email_to}”
上で述べたとおり、emmit_viaは[command]を指定してあるので[command_email]セクションは関係ない。
百歩譲ってもこの80行目で指定してあるcommand_formatの構文にもなんの問題もない。
なのになぜここでautomaticが転けるのか?
ChatGPTと協議した結果、この80行目のkey定義行の先頭に半角スペースが入っているのが問題ではないかという仮説になった。そこでこの半角スペースを削除して再度手動でdnf-automaticを発火させてみた。
→エラーは吐かず正常に発火した。
ということで、長らく解決しなかったdnf-automatic未稼働の問題は、/etc/dnf/automatic.confの稼働となんの関係もないセクションに紛れ込んだ半角スペースが原因だったらしい。
dnf-automaticは、更新通知メールのセクションをemail/command/command_emailに区切るなど、いまいちよく解らない構文を平気で使ったりしている。私はこのconfファイルの表現は大変晦渋だと感じていたのだが、まさか運用上なんの関係もないキー定義行先頭に半角スペースがたったひとつ紛れ込んだだけでINI構文が壊れているとみなして全動作を停止させているとは想像もつかなかった。
dnf-automaticは多くの人の役に立つツールであると日頃感謝している。だが、こうした作者側の荒削りな部分はやや厄介だ。dnf-automaticでInitPareser Illegalエラーが出たらキー定義行に半角スペースが混じっていないかにも注意を向けてみる必要があるだろう。
