package/avahi: Add sysusers.d snippet
authorChris Lesiak <chris.lesiak@licor.com>
Tue, 23 Jan 2018 23:20:05 +0000 (17:20 -0600)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 26 Mar 2018 20:55:49 +0000 (22:55 +0200)
Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/avahi/avahi.mk
package/avahi/avahi_sysusers.conf [new file with mode: 0644]

index ef621620f0cc1bebf43d65fa9be1e2d18c9b573e..baffe3cb69e7dc9bb5cd14e5c31372bf78c82637 100644 (file)
@@ -190,6 +190,13 @@ endif
 
 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y)
+define AVAHI_INSTALL_SYSTEMD_SYSUSERS
+       $(INSTALL) -D -m 644 package/avahi/avahi_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/avahi.conf
+endef
+endif
+
 define AVAHI_INSTALL_INIT_SYSTEMD
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 
@@ -201,6 +208,8 @@ define AVAHI_INSTALL_INIT_SYSTEMD
 
        $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
                $(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
+
+       $(AVAHI_INSTALL_SYSTEMD_SYSUSERS)
 endef
 
 define AVAHI_INSTALL_DAEMON_INIT_SYSV
diff --git a/package/avahi/avahi_sysusers.conf b/package/avahi/avahi_sysusers.conf
new file mode 100644 (file)
index 0000000..463ce97
--- /dev/null
@@ -0,0 +1,5 @@
+# sysusers.d snippet for creating the avahi system user automatically
+# at boot on systemd-based systems that ship with an unpopulated
+# /etc. See sysusers.d(5) for details.
+
+u avahi - "Avahi mDNS/DNS-SD Stack"