# Regular build
LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --with-systemdsystemunitdir=no"
LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --with-launchddaemonsdir=no"
+ LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --with-sysusersdir=no"
make distcheck DISTCHECK_CONFIGURE_FLAGS="$LLDPD_CONFIG_ARGS"
fi
# systemd and launchd files are not installed in the prefix, don't
# request them for distcheck
DISTCHECK_CONFIGURE_FLAGS = \
+ --with-sysusersdir=no \
--with-systemdsystemunitdir=no \
--with-launchddaemonsdir=no
AC_CONFIG_FILES([osx/Makefile osx/distribution.xml osx/im.bernat.lldpd.plist])
AC_CONFIG_FILES([osx/scripts/preinstall], [chmod +x osx/scripts/preinstall])
AC_CONFIG_FILES([osx/scripts/postinstall], [chmod +x osx/scripts/postinstall])
-AC_CONFIG_FILES([src/daemon/lldpd.service])
+AC_CONFIG_FILES([src/daemon/lldpd.service src/daemon/lldpd.sysusers.conf])
AC_CONFIG_FILES([src/daemon/lldpd.8 src/client/lldpcli.8])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([CONFIGURE_ARGS], [$ac_configure_args])
AM_CONDITIONAL(HAVE_SYSTEMDSYSTEMUNITDIR,
[test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+# sysusers
+lldp_ARG_WITH([sysusersdir], [Directory for sysusers files],
+ [$($PKG_CONFIG --variable=sysusersdir systemd 2> /dev/null)])
+AC_SUBST([sysusersdir], [$with_sysusersdir])
+AM_CONDITIONAL(HAVE_SYSUSERSDIR,
+ [test -n "$with_sysusersdir" -a "x$with_sysusersdir" != xno ])
+
# Systemtap/DTrace
lldp_SYSTEMTAP
--with-privsep-group=%lldpd_group \
--with-privsep-chroot=%lldpd_chroot \
--with-systemdsystemunitdir=no \
+ --with-sysusersdir=no \
--prefix=/usr --localstatedir=%{_localstatedir} --sysconfdir=/etc --libdir=%{_libdir} \
--docdir=%{_docdir}/lldpd
if HAVE_SYSTEMDSYSTEMUNITDIR
systemdsystemunit_DATA = lldpd.service
endif
+
+if HAVE_SYSUSERSDIR
+sysusers_DATA = lldpd.sysusers.conf
+endif
--- /dev/null
+# System user and group for lldpd
+# @PRIVSEP_USER@:@PRIVSEP_GROUP@
+
+# Type Name ID GECOS Home
+u @PRIVSEP_USER@ - "lldpd user" @PRIVSEP_CHROOT@
+m @PRIVSEP_USER@ @PRIVSEP_GROUP@