BINDエラーとnamed-chroot.serviceスクリプト修正
3ヶ月ぶりに自宅に戻りましたので、サーバーをチェックしてみたら…電源が落ちていました… orz 停電でもあったのかな?
≫記事『サーバー完全ダウン状態』
早速サーバーを立ち上げてみると…何かおかしい? systemctl statusで各サービスをチェックしてみると、BINDの起動でエラー発生。
# systemctl status named-chroot
● named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 水 2016-02-03 20:35:28 JST; 14h ago
Main PID: 883 (code=exited, status=0/SUCCESS)
2月 3 20:35:28 pc-linux systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
2月 3 20:35:28 pc-linux bash[28000]: /etc/named.conf:70: open: /etc/named.dukeh...nd
2月 3 20:35:28 pc-linux systemd[1]: named-chroot.service: control process exite...=1
2月 3 20:35:28 pc-linux systemd[1]: Failed to start Berkeley Internet Name Doma...).
2月 3 20:35:28 pc-linux systemd[1]: Unit named-chroot.service entered failed state.
2月 3 20:35:28 pc-linux systemd[1]: named-chroot.service failed.
2月 3 18:35:29 pc-linux systemd[1]: Unit named-chroot.service cannot be reloade...e.
2月 3 18:35:29 pc-linux systemd[1]: Unit named-chroot.service cannot be reloade...e.
Hint: Some lines were ellipsized, use -l to show in full.
● named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 水 2016-02-03 20:35:28 JST; 14h ago
Main PID: 883 (code=exited, status=0/SUCCESS)
2月 3 20:35:28 pc-linux systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
2月 3 20:35:28 pc-linux bash[28000]: /etc/named.conf:70: open: /etc/named.dukeh...nd
2月 3 20:35:28 pc-linux systemd[1]: named-chroot.service: control process exite...=1
2月 3 20:35:28 pc-linux systemd[1]: Failed to start Berkeley Internet Name Doma...).
2月 3 20:35:28 pc-linux systemd[1]: Unit named-chroot.service entered failed state.
2月 3 20:35:28 pc-linux systemd[1]: named-chroot.service failed.
2月 3 18:35:29 pc-linux systemd[1]: Unit named-chroot.service cannot be reloade...e.
2月 3 18:35:29 pc-linux systemd[1]: Unit named-chroot.service cannot be reloade...e.
Hint: Some lines were ellipsized, use -l to show in full.
しかも厄介なのが、このBINDエラーが発生するとルーターにも影響を及ぼし、ネットに接続不可となってしまいます。こうなるとルーターを再起動しないとどうにもならないので、修正するまでBINDは停止。
色々と調べてみましたが、今回のエラーはかなり手間取りました。どうやら起動スクリプトを修正するしか方法がなさそうです。
https://bugzilla.redhat.com/show_bug.cgi?id=1278082
# yum -y update
# vi /usr/lib/systemd/system/named-chroot.service
#ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' ← 行頭に#を追加してコメントアウト
ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf; else echo "Checking of zone files is disabled"; ← 追加
# systemctl daemon-reload
# systemctl restart named-chroot
# systemctl status named-chroot
● named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)
Active: active (running) since 水 2016-02-03 20:51:13 JST; 6s ago
Process: 5144 ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 5145 (named)
CGroup: /system.slice/named-chroot.service
└─5145 /usr/sbin/named -u named -t /var/named/chroot -4
2月 3 20:51:13 pc-linux named[5145]: zone 0.168.192.in-addr.arpa/IN/internal: ...01
2月 3 20:51:13 pc-linux named[5145]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0... 0
2月 3 20:51:13 pc-linux named[5145]: zone dukehide.dip.jp/IN/internal: loaded s...01
2月 3 20:51:13 pc-linux named[5145]: zone localhost/IN/internal: loaded serial 0
2月 3 20:51:13 pc-linux named[5145]: zone localhost.localdomain/IN/internal: lo... 0
2月 3 20:51:13 pc-linux named[5145]: zone dukehide.mydns.jp/IN/internal: loaded...01
2月 3 20:51:13 pc-linux named[5145]: all zones loaded
2月 3 20:51:13 pc-linux named[5145]: running
2月 3 20:51:13 pc-linux systemd[1]: Started Berkeley Internet Name Domain (DNS).
Hint: Some lines were ellipsized, use -l to show in full.
# vi /usr/lib/systemd/system/named-chroot.service
#ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' ← 行頭に#を追加してコメントアウト
ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf; else echo "Checking of zone files is disabled"; ← 追加
# systemctl daemon-reload
# systemctl restart named-chroot
# systemctl status named-chroot
● named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)
Active: active (running) since 水 2016-02-03 20:51:13 JST; 6s ago
Process: 5144 ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 5145 (named)
CGroup: /system.slice/named-chroot.service
└─5145 /usr/sbin/named -u named -t /var/named/chroot -4
2月 3 20:51:13 pc-linux named[5145]: zone 0.168.192.in-addr.arpa/IN/internal: ...01
2月 3 20:51:13 pc-linux named[5145]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0... 0
2月 3 20:51:13 pc-linux named[5145]: zone dukehide.dip.jp/IN/internal: loaded s...01
2月 3 20:51:13 pc-linux named[5145]: zone localhost/IN/internal: loaded serial 0
2月 3 20:51:13 pc-linux named[5145]: zone localhost.localdomain/IN/internal: lo... 0
2月 3 20:51:13 pc-linux named[5145]: zone dukehide.mydns.jp/IN/internal: loaded...01
2月 3 20:51:13 pc-linux named[5145]: all zones loaded
2月 3 20:51:13 pc-linux named[5145]: running
2月 3 20:51:13 pc-linux systemd[1]: Started Berkeley Internet Name Domain (DNS).
Hint: Some lines were ellipsized, use -l to show in full.
named-chroot.serviceを書き換えてどうにかOK。いやはやネットの情報で助かりましたが、起動スクリプトの根本的な修正はいつになるのやら…。