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

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

18月 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)
28月 29 08:54:02 adserver samba[107156]:   /usr/local/samba/sbin/samba_dnsupdate: ImportError: No module named dns.resolver
38月 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)
48月 29 08:54:02 adserver samba[107156]:   dnsupdate_nameupdate_done: Failed DNS update with exit code 1
58月 29 08:54:03 adserver winbindd[107159]: [2019/08/29 08:54:03.430795,  0] ../../source3/winbindd/winbindd_cache.c:3166(initialize_winbindd_cache)
68月 29 08:54:03 adserver winbindd[107159]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
78月 29 08:54:03 adserver smbd[107151]: [2019/08/29 08:54:03.438943,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
88月 29 08:54:03 adserver smbd[107151]:   daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
98月 29 08:54:03 adserver winbindd[107159]: [2019/08/29 08:54:03.454411,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
108月 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」の対応

現状の確認方法

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

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

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

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

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

1[root@adserver ~]# yum install python-dns.noarch
2読み込んだプラグイン:fastestmirror
3Loading mirror speeds from cached hostfile
4epel/x86_64/metalink                                     | 7.3 kB     00:00
5 * base: ftp.riken.jp
6 * epel: ftp.riken.jp
7 * extras: ftp.riken.jp
8 * updates: ftp.riken.jp
9base                                                     | 3.6 kB     00:00
10epel                                                     | 5.4 kB     00:00
11extras                                                   | 3.4 kB     00:00
12packages-microsoft-com-prod                              | 2.9 kB     00:00
13updates                                                  | 3.4 kB     00:00
14(1/3): epel/x86_64/updateinfo                              | 998 kB   00:02
15(2/3): packages-microsoft-com-prod/primary_db              | 200 kB   00:00
16(3/3): epel/x86_64/primary_db                              | 6.8 MB   00:03
17依存性の解決をしています
18--> トランザクションの確認を実行しています。
19---> パッケージ python-dns.noarch 0:1.12.0-4.20150617git465785f.el7 を インスト ール
20--> 依存性解決を終了しました。
21 
22依存性を解決しました
23 
24================================================================================
25 Package        アーキテクチャー
26                           バージョン                            リポジトリー
27                                                                           容量
28================================================================================
29インストール中:
30 python-dns     noarch     1.12.0-4.20150617git465785f.el7       base     233 k
31 
32トランザクションの要約
33================================================================================
34インストール  1 パッケージ
35 
36総ダウンロード容量: 233 k
37インストール容量: 1.0 M
38Is this ok [y/d/N]: y
39Downloading packages:
40python-dns-1.12.0-4.20150617git465785f.el7.noarch.rpm      | 233 kB   00:00
41Running transaction check
42Running transaction test
43Transaction test succeeded
44Running transaction
45  インストール中          : python-dns-1.12.0-4.20150617git465785f.el7.no   1/1
46  検証中                  : python-dns-1.12.0-4.20150617git465785f.el7.no   1/1
47 
48インストール:
49  python-dns.noarch 0:1.12.0-4.20150617git465785f.el7
50 
51完了しました!
52[root@adserver ~]#

動作確認・・・

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

それ以外のログについて

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

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

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

コメントを残す

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StatCounter - Free Web Tracker and Counter