<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nathanhammond</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nathanhammond"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/Nathanhammond"/>
	<updated>2026-04-20T10:05:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=21407</id>
		<title>Avahi</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=21407"/>
		<updated>2012-01-14T11:35:20Z</updated>

		<summary type="html">&lt;p&gt;Nathanhammond: Note an issue in installing via command line.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Avahi=&lt;br /&gt;
[http://avahi.org Avahi] is a Linux service for providing multicast-DNS/DNS-SD (also known as [http://en.wikipedia.org/wiki/Bonjour_%28software%29 Bonjour] or mDNS/DNS-SD). Avahi allows for simple service discovery and advertisement on a local network and provides name resolution for all hosts running a mDNS/DNS-SD service.&lt;br /&gt;
&lt;br /&gt;
Using Avahi allows for easy SSH access, among other things, over a local wireless network. Once installed and started, users can ssh to their device using their mDNS assigned hostname.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Avahi Installation==&lt;br /&gt;
&lt;br /&gt;
For 2.x and 3.x devices, avahi can be found in the alpha repo, any other devices install via ipkg as follows:&lt;br /&gt;
&lt;br /&gt;
First, use novacom to access the Pre and install the Avahi ipkg.&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; sudo /opt/bin/ipkg-opt install avahi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avahi seems to want to run as a user named &amp;quot;avahi&amp;quot;.  To create the user, run the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; adduser -h /opt/var/run/avahi avahi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avahi currently attempts to access a different dbus system socket than the one provided by the Pre's dbus, it is possible to start Avahi with dbus support by creating a symbolic link from palm dbus directory to the /opt dbus directory and starting avahi daemon with root privileges. According to the Avahi website, however running avahi-daemon with root privileges is not recommended.&lt;br /&gt;
&lt;br /&gt;
The following command will create a symbolic link to /opt dbus directory to palm dbus directory:&lt;br /&gt;
&lt;br /&gt;
 ln -s /var/run/dbus /opt/var/run/dbus&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if preferred avahi can be be ran without dbus support by editing &amp;lt;tt&amp;gt;/opt/etc/avahi/avahi-daemon.conf&amp;lt;/tt&amp;gt; and make the following change:&lt;br /&gt;
&lt;br /&gt;
 Replace this line:&lt;br /&gt;
 #enable-dbus=yes&lt;br /&gt;
 &lt;br /&gt;
 With this line:&lt;br /&gt;
 enable-dbus=no&lt;br /&gt;
&lt;br /&gt;
However, this does not allow the use of avahi commands such as avahi-browse, avahi-publish etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point, the Avahi daemon can be started with root privileges and dbus support with the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; /opt/sbin/avahi-daemon --no-drop-root&lt;br /&gt;
&lt;br /&gt;
If you disabled dbus support however it is recommended to run Avahi daemon without root privileges using the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; /opt/sbin/avahi-daemon&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you would like Avahi to start up at boot, create the following two files: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/init.d/S60avahi'''&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 [ -e /opt/etc/default/avahi ] &amp;amp;&amp;amp; . /opt/etc/default/avahi&lt;br /&gt;
 &lt;br /&gt;
 if [ &amp;quot;$AVAHI_ENABLE&amp;quot; = &amp;quot;no&amp;quot; ]; then&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ -n &amp;quot;`pidof /opt/sbin/avahi-daemon`&amp;quot; ]; then &lt;br /&gt;
     killall /opt/sbin/avahi 2&amp;gt;/dev/null&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 /opt/sbin/avahi-daemon -D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/default/avahi'''&lt;br /&gt;
 AVAHI_ENABLE=yes&lt;br /&gt;
&lt;br /&gt;
Make sure you set the startup script to executable:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; chmod 755 /opt/etc/init.d/S60avahi&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can create an upstart script at '''/etc/event.d/avahi-daemon''':&lt;br /&gt;
 # avahi-daemon - mDNS/DNS-SD daemon&lt;br /&gt;
 #&lt;br /&gt;
 # The Avahi daemon provides mDNS/DNS-SD discovery support (Bonjour/Zeroconf)&lt;br /&gt;
 # allowing applications to discover services on the network.&lt;br /&gt;
 &lt;br /&gt;
 description	&amp;quot;mDNS/DNS-SD daemon&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 start on started LunaSysMgr&lt;br /&gt;
 respawn&lt;br /&gt;
 &lt;br /&gt;
 console none&lt;br /&gt;
 &lt;br /&gt;
 exec /opt/sbin/avahi-daemon&lt;br /&gt;
&lt;br /&gt;
NOTE 1: This script is not being stored in the /opt directory. You may have to replace it after an update, and it may cause problems with your Pre.&lt;br /&gt;
&lt;br /&gt;
NOTE 2: You may find your device appearing at '''hostname-4.local''' instead of simply '''hostname.local'''. Restarting avahi-daemon (stop avahi, start avahi) will fix that. You could also figure out the root cause for that problem and address it in a pre-start block in the upstart script.&lt;br /&gt;
&lt;br /&gt;
NOTE 3: The Preware alpha feed approach creates a similar upstart script at '''/var/palm/event.d/org.webosinternals.avahi-daemon'''&lt;br /&gt;
&lt;br /&gt;
==Connecting via SSH using mDNS==&lt;br /&gt;
&lt;br /&gt;
mDNS uses the system's hostname and appends it to the &amp;lt;tt&amp;gt;local.&amp;lt;/tt&amp;gt; domain. Using the Pre's default &amp;lt;tt&amp;gt;palm-webos-device&amp;lt;/tt&amp;gt; hostname, the following command would be used to SSH to your Pre on port 222:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; ssh -P 222 palm-webos-device.local.&lt;br /&gt;
&lt;br /&gt;
If you are using an OpenSSH key to connect:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; ssh -i /path/to/ssh/key palm-webos-device.local. &lt;br /&gt;
&lt;br /&gt;
'''Note: The system that you are connecting from MUST have a mDNS service also running, else the hostname will not resolve'''&lt;br /&gt;
&lt;br /&gt;
==Current Issues on the Pre==&lt;br /&gt;
&lt;br /&gt;
* The ipkg binary of Avahi attempts to find the dbus socket at &amp;lt;tt&amp;gt;/opt/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;, but the Pre's dbus socket is at &amp;lt;tt&amp;gt;/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;. I have detailed a solution by running Avahi with root privileges however an approach which allow it to run after dropping root privileges is preferred.&lt;br /&gt;
* The avahi-daemon seems to have issues keeping the mDNS name resolution running for more than a few minutes. I don't know if this is a power management issue or something else at this point.&lt;br /&gt;
* The command line install approach may result in your device appearing at '''hostname-4.local''' due to avahi-daemon believing that your hostname is already claimed on the first run only.&lt;/div&gt;</summary>
		<author><name>Nathanhammond</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=21403</id>
		<title>Avahi</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Avahi&amp;diff=21403"/>
		<updated>2012-01-14T11:30:03Z</updated>

		<summary type="html">&lt;p&gt;Nathanhammond: Update upstart script for command line installation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Avahi=&lt;br /&gt;
[http://avahi.org Avahi] is a Linux service for providing multicast-DNS/DNS-SD (also known as [http://en.wikipedia.org/wiki/Bonjour_%28software%29 Bonjour] or mDNS/DNS-SD). Avahi allows for simple service discovery and advertisement on a local network and provides name resolution for all hosts running a mDNS/DNS-SD service.&lt;br /&gt;
&lt;br /&gt;
Using Avahi allows for easy SSH access, among other things, over a local wireless network. Once installed and started, users can ssh to their device using their mDNS assigned hostname.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Avahi Installation==&lt;br /&gt;
&lt;br /&gt;
For 2.x and 3.x devices, avahi can be found in the alpha repo, any other devices install via ipkg as follows:&lt;br /&gt;
&lt;br /&gt;
First, use novacom to access the Pre and install the Avahi ipkg.&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; sudo /opt/bin/ipkg-opt install avahi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avahi seems to want to run as a user named &amp;quot;avahi&amp;quot;.  To create the user, run the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; adduser -h /opt/var/run/avahi avahi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avahi currently attempts to access a different dbus system socket than the one provided by the Pre's dbus, it is possible to start Avahi with dbus support by creating a symbolic link from palm dbus directory to the /opt dbus directory and starting avahi daemon with root privileges. According to the Avahi website, however running avahi-daemon with root privileges is not recommended.&lt;br /&gt;
&lt;br /&gt;
The following command will create a symbolic link to /opt dbus directory to palm dbus directory:&lt;br /&gt;
&lt;br /&gt;
 ln -s /var/run/dbus /opt/var/run/dbus&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if preferred avahi can be be ran without dbus support by editing &amp;lt;tt&amp;gt;/opt/etc/avahi/avahi-daemon.conf&amp;lt;/tt&amp;gt; and make the following change:&lt;br /&gt;
&lt;br /&gt;
 Replace this line:&lt;br /&gt;
 #enable-dbus=yes&lt;br /&gt;
 &lt;br /&gt;
 With this line:&lt;br /&gt;
 enable-dbus=no&lt;br /&gt;
&lt;br /&gt;
However, this does not allow the use of avahi commands such as avahi-browse, avahi-publish etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point, the Avahi daemon can be started with root privileges and dbus support with the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; /opt/sbin/avahi-daemon --no-drop-root&lt;br /&gt;
&lt;br /&gt;
If you disabled dbus support however it is recommended to run Avahi daemon without root privileges using the following command:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; /opt/sbin/avahi-daemon&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you would like Avahi to start up at boot, create the following two files: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/init.d/S60avahi'''&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 [ -e /opt/etc/default/avahi ] &amp;amp;&amp;amp; . /opt/etc/default/avahi&lt;br /&gt;
 &lt;br /&gt;
 if [ &amp;quot;$AVAHI_ENABLE&amp;quot; = &amp;quot;no&amp;quot; ]; then&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ -n &amp;quot;`pidof /opt/sbin/avahi-daemon`&amp;quot; ]; then &lt;br /&gt;
     killall /opt/sbin/avahi 2&amp;gt;/dev/null&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 /opt/sbin/avahi-daemon -D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''/opt/etc/default/avahi'''&lt;br /&gt;
 AVAHI_ENABLE=yes&lt;br /&gt;
&lt;br /&gt;
Make sure you set the startup script to executable:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; chmod 755 /opt/etc/init.d/S60avahi&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can create an upstart script at '''/etc/event.d/avahi-daemon''':&lt;br /&gt;
 # avahi-daemon - mDNS/DNS-SD daemon&lt;br /&gt;
 #&lt;br /&gt;
 # The Avahi daemon provides mDNS/DNS-SD discovery support (Bonjour/Zeroconf)&lt;br /&gt;
 # allowing applications to discover services on the network.&lt;br /&gt;
 &lt;br /&gt;
 description	&amp;quot;mDNS/DNS-SD daemon&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 start on started LunaSysMgr&lt;br /&gt;
 respawn&lt;br /&gt;
 &lt;br /&gt;
 console none&lt;br /&gt;
 &lt;br /&gt;
 exec /opt/sbin/avahi-daemon&lt;br /&gt;
&lt;br /&gt;
NOTE 1: This script is not being stored in the /opt directory. You may have to replace it after an update, and it may cause problems with your Pre.&lt;br /&gt;
&lt;br /&gt;
NOTE 2: You may find your device appearing at '''hostname-4.local''' instead of simply '''hostname.local'''. Restarting avahi-daemon (stop avahi, start avahi) will fix that. You could also figure out the root cause for that problem and address it in a pre-start block in the upstart script.&lt;br /&gt;
&lt;br /&gt;
NOTE 3: The Preware alpha feed approach creates a similar upstart script at '''/var/palm/event.d/org.webosinternals.avahi-daemon'''&lt;br /&gt;
&lt;br /&gt;
==Connecting via SSH using mDNS==&lt;br /&gt;
&lt;br /&gt;
mDNS uses the system's hostname and appends it to the &amp;lt;tt&amp;gt;local.&amp;lt;/tt&amp;gt; domain. Using the Pre's default &amp;lt;tt&amp;gt;palm-webos-device&amp;lt;/tt&amp;gt; hostname, the following command would be used to SSH to your Pre on port 222:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; ssh -P 222 palm-webos-device.local.&lt;br /&gt;
&lt;br /&gt;
If you are using an OpenSSH key to connect:&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; ssh -i /path/to/ssh/key palm-webos-device.local. &lt;br /&gt;
&lt;br /&gt;
'''Note: The system that you are connecting from MUST have a mDNS service also running, else the hostname will not resolve'''&lt;br /&gt;
&lt;br /&gt;
==Current Issues on the Pre==&lt;br /&gt;
&lt;br /&gt;
* The ipkg binary of Avahi attempts to find the dbus socket at &amp;lt;tt&amp;gt;/opt/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;, but the Pre's dbus socket is at &amp;lt;tt&amp;gt;/var/run/dbus/system_bus_socket&amp;lt;/tt&amp;gt;. I have detailed a solution by running Avahi with root privileges however an approach which allow it to run after dropping root privileges is preferred.&lt;br /&gt;
* The avahi-daemon seems to have issues keeping the mDNS name resolution running for more than a few minutes. I don't know if this is a power management issue or something else at this point.&lt;/div&gt;</summary>
		<author><name>Nathanhammond</name></author>
	</entry>
</feed>