J'essaie de me connecter à un PC via mDNS à partir d'un script Bash s'exécutant sous Windows. Bien que je puisse .local
envoyer une requête ping au PC via son adresse mDNS dans CMD, la même chose dans une fenêtre Ubuntu / Bash échoue en raison d'un problème de résolution du nom d'hôte.
Lorsque j'essaie de l'installer avahi-daemon
, il semble que le service ne puisse pas démarrer, ce qui empêche de résoudre les noms mDNS.
$ sudo apt-get install avahi-daemon
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libavahi-common-data libavahi-common3 libavahi-core7 libdaemon0 libnss-mdns
Suggested packages:
avahi-autoipd
The following NEW packages will be installed:
avahi-daemon libavahi-common-data libavahi-common3 libavahi-core7 libdaemon0
libnss-mdns
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 220 kB of archives.
After this operation, 1,094 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-common-data amd64 0.6.31-4ubuntu1 [21.2 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-common3 amd64 0.6.31-4ubuntu1 [21.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-core7 amd64 0.6.31-4ubuntu1 [80.9 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libdaemon0 amd64 0.14-2ubuntu1 [16.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main avahi-daemon amd64 0.6.31-4ubuntu1 [58.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main libnss-mdns amd64 0.10-6 [21.4 kB]
Fetched 220 kB in 1s (159 kB/s)
Selecting previously unselected package libavahi-common-data:amd64.
(Reading database ... 24998 files and directories currently installed.)
Preparing to unpack .../libavahi-common-data_0.6.31-4ubuntu1_amd64.deb ...
Unpacking libavahi-common-data:amd64 (0.6.31-4ubuntu1) ...
Selecting previously unselected package libavahi-common3:amd64.
Preparing to unpack .../libavahi-common3_0.6.31-4ubuntu1_amd64.deb ...
Unpacking libavahi-common3:amd64 (0.6.31-4ubuntu1) ...
Selecting previously unselected package libavahi-core7:amd64.
Preparing to unpack .../libavahi-core7_0.6.31-4ubuntu1_amd64.deb ...
Unpacking libavahi-core7:amd64 (0.6.31-4ubuntu1) ...
Selecting previously unselected package libdaemon0.
Preparing to unpack .../libdaemon0_0.14-2ubuntu1_amd64.deb ...
Unpacking libdaemon0 (0.14-2ubuntu1) ...
Selecting previously unselected package avahi-daemon.
Preparing to unpack .../avahi-daemon_0.6.31-4ubuntu1_amd64.deb ...
Unpacking avahi-daemon (0.6.31-4ubuntu1) ...
Selecting previously unselected package libnss-mdns:amd64.
Preparing to unpack .../libnss-mdns_0.10-6_amd64.deb ...
Unpacking libnss-mdns:amd64 (0.10-6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libavahi-common-data:amd64 (0.6.31-4ubuntu1) ...
Setting up libavahi-common3:amd64 (0.6.31-4ubuntu1) ...
Setting up libavahi-core7:amd64 (0.6.31-4ubuntu1) ...
Setting up libdaemon0 (0.14-2ubuntu1) ...
Setting up avahi-daemon (0.6.31-4ubuntu1) ...
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of force-reload.
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libnss-mdns:amd64 (0.10-6) ...
First installation detected...
Checking NSS setup...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
$ ping my-other-pc.local
ping: unknown host my-other-pc.local
Que dois-je faire pour pouvoir résoudre les noms mDNS? Existe-t-il une alternative à l'installation d'Avahi qui fonctionne, ou y a-t-il autre chose que je dois faire pour que ce paquet fonctionne?
la source