package/avahi: use upstream-provided systemd files
authorAndré Erdmann <dywi@mailerd.de>
Fri, 17 Oct 2014 19:10:42 +0000 (21:10 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 19 Oct 2014 10:45:32 +0000 (12:45 +0200)
When using the buildroot-provided avahi-daemon.service file, bootup never
finishes, because multi-user.target is waiting for avahi-daemon to exit,
which is caused by "Type=oneshot" (in avahi-daemon.service).

Upstream's systemd files get already installed to /lib/systemd.
They're not an exact copy of S50avahi-daemon, but work flawlessly,
so use these units:

* avahi-daemon.service, auto-enabled (ln -fs in AVAHI_INSTALL_INIT_SYSTEMD)
* avahi-daemon.socket,
  not auto-enabled, but a dependency of avahi-daemon.service
* avahi-dnsconfd.service, auto-enabled

[Thomas: use simpler absolute paths for the symbolic links instead of
relative paths. Suggested by Maxime Hadjinlian.]

Signed-off-by: André Erdmann <dywi@mailerd.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/avahi/avahi-daemon.service [deleted file]
package/avahi/avahi.mk

diff --git a/package/avahi/avahi-daemon.service b/package/avahi/avahi-daemon.service
deleted file mode 100644 (file)
index c9b7b1f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Avahi daemon
-Requires=dbus.target
-After=syslog.target network.target auditd.service
-
-[Service]
-Type=oneshot
-RemainAfterExit=ye
-ExecStart=/usr/sbin/avahi-daemon -s
-ExecReload=/usr/sbin/avahi-daemon -r
-ExecStop=/usr/sbin/avahi-daemon -k
-Restart=restart-always
-
-[Install]
-WantedBy=multi-user.target
index 93d093c4865995bacaee890d5191a9786d6c152d..3508002bb5239af945ec1cd9ef672a2ca343a21b 100644 (file)
@@ -164,14 +164,14 @@ endif
 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
 
 define AVAHI_INSTALL_INIT_SYSTEMD
-  $(INSTALL) -D -m 644 package/avahi/avahi-daemon.service \
-    $(TARGET_DIR)/etc/systemd/system/avahi-daemon.service
-
   mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
-  ln -fs ../avahi-daemon.service \
+  ln -fs /lib/systemd/system/avahi-daemon.service \
     $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
 
+  ln -fs /lib/systemd/system/avahi-dnsconfd.service \
+    $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-dnsconfd.service
+
   mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
 
   $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \