samba 4.10.7へアップデートしたあと、「systemctl status samba-ad-dc.service」で出力されるログを見てみたら、微妙な感じのエラーがあった。
1 | 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) |
2 | 8月 29 08:54:02 adserver samba[107156]: /usr/local/samba/sbin/samba_dnsupdate: ImportError: No module named dns.resolver |
3 | 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) |
4 | 8月 29 08:54:02 adserver samba[107156]: dnsupdate_nameupdate_done: Failed DNS update with exit code 1 |
5 | 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) |
6 | 8月 29 08:54:03 adserver winbindd[107159]: initialize_winbindd_cache: clearing cache and re-creating with version number 2 |
7 | 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 | 8月 29 08:54:03 adserver smbd[107151]: daemon_ready: daemon 'smbd' finished starting up and ready to serve connections |
9 | 8月 29 08:54:03 adserver winbindd[107159]: [2019/08/29 08:54:03.454411, 0] ../../lib/util/become_daemon.c:136(daemon_ready) |
10 | 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」の対応
現状の確認方法
1 | [root@adserver ~]# samba_dnsupdate --verbose |
2 | Traceback (most recent call last): |
3 | File "/usr/local/samba/sbin/samba_dnsupdate", line 57, in <module> |
4 | import dns.resolver |
5 | ImportError: No module named dns.resolver |
6 | [root@adserver ~]# |
原因はpythonのDNS toolkitがインストールされていないこと。
CentOS7環境で対処するには「yum search dnspython」を実行してモジュール名を確認
1 | [root@adserver ~]# yum search dnspython |
2 | 読み込んだプラグイン:fastestmirror |
3 | Determining fastest mirrors |
4 | * base: ftp.riken.jp |
5 | * epel: ftp.riken.jp |
6 | * extras: ftp.riken.jp |
7 | * updates: ftp.riken.jp |
8 | =============================== 一致: dnspython ================================ |
9 | python-dns.noarch : DNS toolkit for Python |
10 | python36-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 |
3 | Loading mirror speeds from cached hostfile |
4 | epel/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 |
9 | base | 3.6 kB 00:00 |
10 | epel | 5.4 kB 00:00 |
11 | extras | 3.4 kB 00:00 |
12 | packages-microsoft-com-prod | 2.9 kB 00:00 |
13 | updates | 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 |
38 | Is this ok [y/d/N]: y |
39 | Downloading packages: |
40 | python-dns-1.12.0-4.20150617git465785f.el7.noarch.rpm | 233 kB 00:00 |
41 | Running transaction check |
42 | Running transaction test |
43 | Transaction test succeeded |
44 | Running 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 |
2 | IPs: ['172.17.44.49'] |
3 | Looking for DNS entry A adserver.adosakana.local 172.17.44.49 as adserver.adosakana.local. |
4 | Looking for DNS entry NS adosakana.local adserver.adosakana.local as adosakana.local |
5 | <略> |
6 | Checking 0 100 389 adserver.adosakana.local. against SRV _ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones.adosakana.local adserver.adosakana.local 389 |
7 | No DNS updates needed |
8 | [root@adserver ~]# |
それ以外のログについて
samba_dnsupdateに関するエラーについて対処した後、sambaを再起動してログを見てみると、下記の様な感じになっていた。
1 | 8月 29 09:06:46 adserver samba[107294]: [2019/08/29 09:06:46.991243, 0] ../../source4/smbd/server.c:773(binary_smbd_main) |
2 | 8月 29 09:06:46 adserver samba[107294]: binary_smbd_main: samba: using 'standard' process model |
3 | 8月 29 09:06:47 adserver samba[107294]: [2019/08/29 09:06:47.021548, 0] ../../lib/util/become_daemon.c:136(daemon_ready) |
4 | 8月 29 09:06:47 adserver samba[107294]: daemon_ready: daemon 'samba' finished starting up and ready to serve connections |
5 | 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) |
6 | 8月 29 09:06:49 adserver winbindd[107312]: initialize_winbindd_cache: clearing cache and re-creating with version number 2 |
7 | 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 | 8月 29 09:06:49 adserver winbindd[107312]: daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections |
9 | 8月 29 09:06:50 adserver smbd[107311]: [2019/08/29 09:06:50.436561, 0] ../../lib/util/become_daemon.c:136(daemon_ready) |
10 | 8月 29 09:06:50 adserver smbd[107311]: daemon_ready: daemon 'smbd' finished starting up and ready to serve connections |
RHEL7だと上記出力を赤文字で出力してるけど、内容を見る限りではinformation的なものであるので、特に対処する必要はなさそうである。