aboutsummaryrefslogtreecommitdiff
path: root/package/avahi
diff options
context:
space:
mode:
authorGravatar Maxime Hadjinlian <maxime.hadjinlian@gmail.com>2014-05-03 17:35:45 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-05-03 18:38:53 +0200
commitac6813f18404673a128724400fc3d16dbb67c490 (patch)
tree1c38dfbd32fdd4e3bb2a3a935e58466c0b38e7d8 /package/avahi
parentaffb6a38535382526333517e86ee5a31df0064fe (diff)
downloadbuildroot-ac6813f18404673a128724400fc3d16dbb67c490.tar.gz
buildroot-ac6813f18404673a128724400fc3d16dbb67c490.tar.bz2
avahi: Add systemd init script
This consists of two files: - avahi-daemon.service: It start/stop the daemon avahi, it's a copy of the S50avahi-daemon script. - avahi_tmpfiles.conf: This one gets installed in /usr/lib/tmpfiles.d/ to be used by systemd-tmpfiles which will create the correct directory structure with the appropriate rights. This is the equivalent of the S05avahi-setup.sh script. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/avahi')
-rw-r--r--package/avahi/avahi-daemon.service15
-rw-r--r--package/avahi/avahi.mk22
-rw-r--r--package/avahi/avahi_tmpfiles.conf1
3 files changed, 35 insertions, 3 deletions
diff --git a/package/avahi/avahi-daemon.service b/package/avahi/avahi-daemon.service
new file mode 100644
index 0000000000..c9b7b1f135
--- /dev/null
+++ b/package/avahi/avahi-daemon.service
@@ -0,0 +1,15 @@
+[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
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index 609b05da7c..6e84564b2d 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -153,12 +153,28 @@ ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_AUTOIPD
endif
-define AVAHI_INSTALL_DAEMON_INITSCRIPT
+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 \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
+
+ mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
+
+ $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
+ $(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
+
+endef
+
+define AVAHI_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/
endef
-ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
-AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_DAEMON_INITSCRIPT
endif
$(eval $(autotools-package))
diff --git a/package/avahi/avahi_tmpfiles.conf b/package/avahi/avahi_tmpfiles.conf
new file mode 100644
index 0000000000..41eb3c6fb5
--- /dev/null
+++ b/package/avahi/avahi_tmpfiles.conf
@@ -0,0 +1 @@
+d /tmp/avahi-autopid 0755 default default