| 29 | |
| 30 | = NFS with DHCP = |
| 31 | * 結果として、静的割当を行わないと起動時のマウントには成功しなかった |
| 32 | |
| 33 | * Linux 4.4.5-1-ARCH |
| 34 | * nfs-utils 1.3.3-3 |
| 35 | |
| 36 | * mitty@nfs-client:~$ systemctl status srv-nfs4.mount |
| 37 | {{{ |
| 38 | ● srv-nfs4.mount - /srv/nfs4 |
| 39 | Loaded: loaded (/etc/fstab; bad; vendor preset: disabled) |
| 40 | Active: failed (Result: exit-code) since Tue 2016-03-15 00:20:17 JST; 7min ago |
| 41 | Where: /srv/nfs4 |
| 42 | What: nfs-server.local.mitty.jp:/ |
| 43 | Docs: man:fstab(5) |
| 44 | man:systemd-fstab-generator(8) |
| 45 | |
| 46 | Mar 15 00:20:17 nfs-client systemd[1]: Mounting /srv/nfs4... |
| 47 | Mar 15 00:20:17 nfs-client mount[229]: mount.nfs4: Failed to resolve server nfs-server.local.mitty.jp: Name or service not known |
| 48 | Mar 15 00:20:17 nfs-client systemd[1]: srv-nfs4.mount: Mount process exited, code=exited status=32 |
| 49 | Mar 15 00:20:17 nfs-client systemd[1]: Failed to mount /srv/nfs4. |
| 50 | Mar 15 00:20:17 nfs-client systemd[1]: srv-nfs4.mount: Unit entered failed state. |
| 51 | }}} |
| 52 | * [[Image(nfs-dhcp.png,33%)]] |
| 53 | |
| 54 | * 以下、効果が無かったもの |
| 55 | * rpcbind.service, nfs-client.serviceの有効化 |
| 56 | {{{ |
| 57 | mitty@nfs-client:~$ sudo systemctl enable rpcbind.service |
| 58 | Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket to /usr/lib/systemd/system/rpcbind.socket. |
| 59 | mitty@nfs-client:~$ sudo systemctl enable nfs-client.target |
| 60 | Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-client.target to /usr/lib/systemd/system/nfs-client.target. |
| 61 | Created symlink from /etc/systemd/system/remote-fs.target.wants/nfs-client.target to /usr/lib/systemd/system/nfs-client.target. |
| 62 | mitty@nfs-client:~$ sudo systemctl enable remote-fs.target |
| 63 | }}} |
| 64 | * [http://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html Linux tip: Force systemd networkd to wait for DHCP | @Blog("Baptiste Wicht")] |
| 65 | {{{ |
| 66 | mitty@nfs-client:~$ sudo vim /etc/systemd/system/multi-user.target.wants/remote-fs.target |
| 67 | Wants=network-online.target |
| 68 | After=remote-fs-pre.target network-online.target |
| 69 | mitty@nfs-client:~$ sudo systemctl enable systemd-networkd-wait-online.service |
| 70 | Created symlink from /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service to /usr/lib/systemd/system/systemd-networkd-wait-online.service. |
| 71 | }}} |
| 72 | {{{ |
| 73 | Wants=dhcpcd.service |
| 74 | After=remote-fs-pre.target dhcpcd.service |
| 75 | }}} |