samba 4.10.x環境で出てたsamba_dnsupdateのエラー対処


samba 4.10.7へアップデートしたあと、「systemctl status samba-ad-dc.service」で出力されるログを見てみたら、微妙な感じのエラーがあった。

 8月 29 08:54:02 adserver samba[107156]: [2019/08/29 08:54:02.287210,  0] ../../lib/util/util_runcmd.c:327(samba_runcmd_io_handler)
 8月 29 08:54:02 adserver samba[107156]:   /usr/local/samba/sbin/samba_dnsupdate: ImportError: No module named dns.resolver
 8月 29 08:54:02 adserver samba[107156]: [2019/08/29 08:54:02.295161,  0] ../../source4/dsdb/dns/dns_update.c:331(dnsupdate_nameupdate_done)
 8月 29 08:54:02 adserver samba[107156]:   dnsupdate_nameupdate_done: Failed DNS update with exit code 1
 8月 29 08:54:03 adserver winbindd[107159]: [2019/08/29 08:54:03.430795,  0] ../../source3/winbindd/winbindd_cache.c:3166(initialize_winbindd_cache)
 8月 29 08:54:03 adserver winbindd[107159]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
 8月 29 08:54:03 adserver smbd[107151]: [2019/08/29 08:54:03.438943,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
 8月 29 08:54:03 adserver smbd[107151]:   daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
 8月 29 08:54:03 adserver winbindd[107159]: [2019/08/29 08:54:03.454411,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
 8月 29 08:54:03 adserver winbindd[107159]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections

「samba_dnsupdate: ImportError: No module named dns.resolver」の対応

現状の確認方法

[root@adserver ~]# samba_dnsupdate --verbose
Traceback (most recent call last):
  File "/usr/local/samba/sbin/samba_dnsupdate", line 57, in <module>
    import dns.resolver
ImportError: No module named dns.resolver
[root@adserver ~]#

原因はpythonのDNS toolkitがインストールされていないこと。

CentOS7環境で対処するには「yum search dnspython」を実行してモジュール名を確認

[root@adserver ~]# yum search dnspython
読み込んだプラグイン:fastestmirror
Determining fastest mirrors
 * base: ftp.riken.jp
 * epel: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
=============================== 一致: dnspython ================================
python-dns.noarch : DNS toolkit for Python
python36-dns.noarch : DNS toolkit for Python 3
[root@adserver ~]#

今回使っている環境はpython 2環境なので、「yum install python-dns」でインストール。

[root@adserver ~]# yum install python-dns.noarch
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 7.3 kB     00:00
 * base: ftp.riken.jp
 * epel: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
base                                                     | 3.6 kB     00:00
epel                                                     | 5.4 kB     00:00
extras                                                   | 3.4 kB     00:00
packages-microsoft-com-prod                              | 2.9 kB     00:00
updates                                                  | 3.4 kB     00:00
(1/3): epel/x86_64/updateinfo                              | 998 kB   00:02
(2/3): packages-microsoft-com-prod/primary_db              | 200 kB   00:00
(3/3): epel/x86_64/primary_db                              | 6.8 MB   00:03
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ python-dns.noarch 0:1.12.0-4.20150617git465785f.el7 を インスト ール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package        アーキテクチャー
                           バージョン                            リポジトリー
                                                                           容量
================================================================================
インストール中:
 python-dns     noarch     1.12.0-4.20150617git465785f.el7       base     233 k

トランザクションの要約
================================================================================
インストール  1 パッケージ

総ダウンロード容量: 233 k
インストール容量: 1.0 M
Is this ok [y/d/N]: y
Downloading packages:
python-dns-1.12.0-4.20150617git465785f.el7.noarch.rpm      | 233 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : python-dns-1.12.0-4.20150617git465785f.el7.no   1/1
  検証中                  : python-dns-1.12.0-4.20150617git465785f.el7.no   1/1

インストール:
  python-dns.noarch 0:1.12.0-4.20150617git465785f.el7

完了しました!
[root@adserver ~]#

動作確認・・・

[root@adserver ~]# samba_dnsupdate --verbose
IPs: ['172.17.44.49']
Looking for DNS entry A adserver.adosakana.local 172.17.44.49 as adserver.adosakana.local.
Looking for DNS entry NS adosakana.local adserver.adosakana.local as adosakana.local
<略>
Checking 0 100 389 adserver.adosakana.local. against SRV _ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones.adosakana.local adserver.adosakana.local 389
No DNS updates needed
[root@adserver ~]#

それ以外のログについて

samba_dnsupdateに関するエラーについて対処した後、sambaを再起動してログを見てみると、下記の様な感じになっていた。

 8月 29 09:06:46 adserver samba[107294]: [2019/08/29 09:06:46.991243,  0] ../../source4/smbd/server.c:773(binary_smbd_main)
 8月 29 09:06:46 adserver samba[107294]:   binary_smbd_main: samba: using 'standard' process model
 8月 29 09:06:47 adserver samba[107294]: [2019/08/29 09:06:47.021548,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
 8月 29 09:06:47 adserver samba[107294]:   daemon_ready: daemon 'samba' finished starting up and ready to serve connections
 8月 29 09:06:49 adserver winbindd[107312]: [2019/08/29 09:06:49.157089,  0] ../../source3/winbindd/winbindd_cache.c:3166(initialize_winbindd_cache)
 8月 29 09:06:49 adserver winbindd[107312]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
 8月 29 09:06:49 adserver winbindd[107312]: [2019/08/29 09:06:49.266323,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
 8月 29 09:06:49 adserver winbindd[107312]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections
 8月 29 09:06:50 adserver smbd[107311]: [2019/08/29 09:06:50.436561,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
 8月 29 09:06:50 adserver smbd[107311]:   daemon_ready: daemon 'smbd' finished starting up and ready to serve connections

RHEL7だと上記出力を赤文字で出力してるけど、内容を見る限りではinformation的なものであるので、特に対処する必要はなさそうである。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください