diff mbox

avahi: create missing "services" directory

Message ID 20170704163533.13923-1-maxime.hadjinlian@gmail.com
State Changes Requested
Headers show

Commit Message

Maxime Hadjinlian July 4, 2017, 4:35 p.m. UTC
Fixes a warning in avahi-daemon startup log:
"Failed to read /etc/avahi/services."

This directory can contain services files that you want avahi to
advertise.

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
---
 package/avahi/avahi.mk | 6 ++++++
 1 file changed, 6 insertions(+)

--
2.13.2

Comments

Thomas Petazzoni Aug. 17, 2017, 1:52 p.m. UTC | #1
Hello,

On Tue,  4 Jul 2017 18:35:32 +0200, Maxime Hadjinlian wrote:
> Fixes a warning in avahi-daemon startup log:
> "Failed to read /etc/avahi/services."
> 
> This directory can contain services files that you want avahi to
> advertise.
> 
> Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>

I don't understand why this patch is necessary. Indeed, with the
following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.05-1078-g95b1dae.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_AVAHI=y
BR2_PACKAGE_AVAHI_DAEMON=y

I do get the /etc/avahi/services directory created by the avahi
Makefiles, during the installation step:

>>> avahi 0.6.32 Installing to target
[...]
 /usr/bin/mkdir -p '/home/thomas/projets/buildroot/output/target/etc/avahi/services'
 /usr/bin/mkdir -p '/home/thomas/projets/buildroot/output/target/etc/avahi'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c avahi-daemon '/home/thomas/projets/buildroot/output/target/usr/sbin'
 /usr/bin/install -c -m 644 ssh.service sftp-ssh.service '/home/thomas/projets/buildroot/output/target/etc/avahi/services'

Two files are even installed in this folder.

Of course, if you disable BR2_PACKAGE_AVAHI_DAEMON=y, this folder is
not created, but there's also no S50avahi-daemon init script installed,
and therefore no daemon launched at boot time.

Could you check that your patch is still really needed, and if it is,
extend the commit log to explain under which configuration you're
seeing the problem ?

Thanks a lot,

Thomas
diff mbox

Patch

diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index a356a08291..5f6f3c36b3 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -180,6 +180,12 @@  endef

 AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_REMOVE_INITSCRIPT

+define AVAHI_CREATE_SERVICES_DIRECTORY
+	mkdir -p $(TARGET_DIR)/etc/avahi/services
+endef
+
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_CREATE_SERVICES_DIRECTORY
+
 ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
 define AVAHI_INSTALL_AUTOIPD
 	rm -f $(TARGET_DIR)/var/lib/avahi-autoipd