]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: provide a sysusers.d file
authorVincent Bernat <vincent@bernat.im>
Wed, 3 Sep 2014 23:02:39 +0000 (01:02 +0200)
committerVincent Bernat <vincent@bernat.im>
Wed, 3 Sep 2014 23:02:39 +0000 (01:02 +0200)
This allows systemd-sysusers to create _lldpd user/group. See:
 http://www.freedesktop.org/software/systemd/man/sysusers.d.html

This is currently untested.

.travis/run.sh
Makefile.am
configure.ac
redhat/lldpd.spec
src/daemon/Makefile.am
src/daemon/lldpd.sysusers.conf.in [new file with mode: 0644]

index 3174186df142421ac6a80c6cca8e2f777cb4add6..7e54c87bcfd028123c5844d70fd5f09b2256a286 100755 (executable)
@@ -28,5 +28,6 @@ else
     # 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
index 07390fd86dcb46fdae87e52a44020e7576f8a0d4..f60caf956102c0f417e962e7f66956f7ef66bcde 100644 (file)
@@ -35,5 +35,6 @@ MOSTLYCLEANFILES = $(DX_CLEANFILES)
 # 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
index a85d2d15d5c8e074e5ad96785a4eaa531e6fd93b..34fe40eab0f647010bafe649de629d004533edfc 100644 (file)
@@ -21,7 +21,7 @@ AC_CONFIG_FILES([Makefile src/Makefile src/compat/Makefile src/daemon/Makefile
 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])
@@ -225,6 +225,13 @@ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
 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
 
index 53f0ee0b1ed71f0e8732b79f02a0abedfd42c069..1781b20b72c274de78ccdecd0eb1806472a4525e 100644 (file)
@@ -130,6 +130,7 @@ This package is required to develop alternate clients for lldpd.
    --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
 
index 39ba12aaff34af9a9a41ee2a4690039aacc5ed22..e234f246fe360f7c49c62599a01bf89d23ba66d2 100644 (file)
@@ -144,3 +144,7 @@ endif
 if HAVE_SYSTEMDSYSTEMUNITDIR
 systemdsystemunit_DATA = lldpd.service
 endif
+
+if HAVE_SYSUSERSDIR
+sysusers_DATA = lldpd.sysusers.conf
+endif
diff --git a/src/daemon/lldpd.sysusers.conf.in b/src/daemon/lldpd.sysusers.conf.in
new file mode 100644 (file)
index 0000000..7cbf50a
--- /dev/null
@@ -0,0 +1,6 @@
+# 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@