% grep dhcp /var/log/syslog (一部だけ抜粋) Mar 27 17:47:45 myhost1 dhcpd[888]: Internet Systems Consortium DHCP Server 4.3. 5 Mar 27 17:47:45 myhost1 dhcpd[888]: Copyright 2004-2016 Internet Systems Consort ium. Mar 27 17:47:45 myhost1 dhcpd[888]: All rights reserved. Mar 27 17:47:45 myhost1 dhcpd[888]: For info, please visit https://www.isc.org/s oftware/dhcp/ Mar 27 17:47:45 myhost1 dhcpd[888]: Wrote 1 leases to leases file. Mar 27 17:47:45 myhost1 sh[888]: in your dhcpd.conf file for the network segm ent Mar 27 17:47:45 myhost1 systemd[1]: isc-dhcp-server.service: Main process exited , code=exited, status=1/FAILURE Mar 27 17:47:45 myhost1 dhcpd[888]: Mar 27 17:47:45 myhost1 sh[948]: in your dhcpd.conf file for the network segm ent Mar 27 17:47:45 myhost1 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'. Mar 27 17:47:45 myhost1 dhcpd[888]: No subnet declaration for enp3s0 (no IPv4 ad dresses). Mar 27 17:47:45 myhost1 dhcpd[888]: ** Ignoring requests on enp3s0. If this is not what Mar 27 17:47:45 myhost1 dhcpd[888]: you want, please write a subnet declarati on Mar 27 17:47:45 myhost1 dhcpd[888]: in your dhcpd.conf file for the network s egment Mar 27 17:47:45 myhost1 dhcpd[888]: to which interface enp3s0 is attached. **
Mar 27 17:47:45 myhost1 dhcpd[888]: Mar 27 17:47:45 myhost1 dhcpd[888]: Mar 27 17:47:45 myhost1 dhcpd[888]: Not configured to listen on any interfaces! Mar 27 17:47:45 myhost1 dhcpd[888]: Mar 27 17:47:45 myhost1 dhcpd[888]: If you think you have received this message due to a bug rather Mar 27 17:47:45 myhost1 dhcpd[888]: than a configuration issue please read the s ection on submitting Mar 27 17:47:45 myhost1 dhcpd[888]: bugs on either our web page at www.isc.org o r in the README file Mar 27 17:47:45 myhost1 dhcpd[888]: before submitting a bug. These pages explai n the proper Mar 27 17:47:45 myhost1 dhcpd[888]: process and the information we find helpful for debugging.. Mar 27 17:47:45 myhost1 dhcpd[888]: Mar 27 17:47:45 myhost1 dhcpd[888]: exiting. Mar 27 17:47:45 myhost1 dhcpd[948]: Mar 27 17:47:45 myhost1 dhcpd[948]: No subnet6 declaration for enp3s0 (no IPv6 a ddresses). Mar 27 17:47:45 myhost1 dhcpd[948]: ** Ignoring requests on enp3s0. If this is not what ... (以降略)
これによると,どうやらNICの設定が終わる前に,DHCPサーバの起動処理が走ってしまい,動作できるNICが見つからないため,エラーになっているということらしい.なので「NICの設定が終わるまで,DHCPサーバの起動処理を遅らせておけ」とある.これって,いわゆる Bad know-how なの?と思った.が,計算機の起動時に自動的にDHCPがスタートして欲しいので,仕方なく以下のようにsystemdの起動ファイルを1行だけ修正する.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
% cd /etc/systemd/system/multi-user.target.wants % cat isc-dhcp-server.service [Unit] Description=ISC DHCP IPv4 server ...(省略)... # The leases files need to be root:dhcpd even when dropping privileges ExecStart=/bin/sh -ec '\ CONFIG_FILE=/etc/dhcp/dhcpd.conf; \ if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi; \ [ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases; \ chown root:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd.leases; \ chmod 775 /var/lib/dhcp ; chmod 664 /var/lib/dhcp/dhcpd.leases; \ sleep 15; \ exec dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf $CONFIG_FILE $INTERFACES' ...(省略)...