Пытаюсь настроить автомонтирование smb в Ubuntu 18 LTS. Netplan создал netplan-wpa@wlp2s0.service. Делаю юнит для системд:
cat ./media-nas-music.mount
[Unit]
Description=music nas mount
Requires=netplan-wpa@wlp2s0.service
After=netplan-wpa@wlp2s0.service systemd-resolved.service
Wants=netplan-wpa@wlp2s0.service systemd-resolved.service
[Mount]
What=//192.168.100.5/music
Where=/media/nas/music
Type=cifs
Options=username=UUU,password=XXX,file_mode=0777,dir_mode=0777
TimeoutSec=30
[Install]
WantedBy=multi-user.target
Через systemctl start media-nas-music.mount монтируется нормально. Но при рестарте системы:
systemctl status media-nas-music.mount
● media-nas-music.mount - music nas mount
Loaded: loaded (/etc/systemd/system/media-nas-music.mount; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-07-08 13:40:29 UTC; 16min ago
Where: /media/nas/music
What: //192.168.100.5/music
Process: 1303 ExecMount=/bin/mount //192.168.100.5/music /media/nas/music -t cifs -o username=UUU,password=XXX,file_mode=0777,dir_mode=0777 (code=exited, status=32)
июл 08 13:40:29 htpc systemd[1]: Mounting music nas mount...
июл 08 13:40:29 htpc mount[1303]: mount: /media/nas/music: mount(2) system call failed: Network is unreachable.
июл 08 13:40:29 htpc systemd[1]: media-nas-music.mount: Mount process exited, code=exited status=32
июл 08 13:40:29 htpc systemd[1]: media-nas-music.mount: Failed with result 'exit-code'.
июл 08 13:40:29 htpc systemd[1]: Failed to mount music nas mount.