uuidd: add systemd unit files
Add systemd unit files which use the socket activation mechanism of systemd. The uuidd deamon is started upon first request on the socket and quits after 1 minute of inactivity. Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
This commit is contained in:
parent
7ec85b5b71
commit
1b68c37927
|
@ -89,7 +89,8 @@ checkxalloc:
|
|||
|
||||
ENABLE_ALL = --enable-static-programs --enable-most-builds
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-use-tty-group \
|
||||
--disable-silent-rules $(ENABLE_ALL)
|
||||
--disable-silent-rules $(ENABLE_ALL) \
|
||||
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
|
||||
|
||||
|
||||
BUILT_SOURCES = .version
|
||||
|
|
11
configure.ac
11
configure.ac
|
@ -1142,6 +1142,16 @@ if test "x$enable_socket_activation" = xyes; then
|
|||
AC_DEFINE(USE_SOCKET_ACTIVATION, 1, [Should uuidd support socket activation?])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([systemdsystemunitdir],
|
||||
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd service files]),
|
||||
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
|
||||
|
||||
if test "x$with_systemdsystemunitdir" != "xno"; then
|
||||
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([login-stat-mail],
|
||||
AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
|
||||
|
@ -1265,6 +1275,7 @@ libuuid/uuid.pc
|
|||
login-utils/Makefile
|
||||
man/ru/Makefile
|
||||
misc-utils/Makefile
|
||||
misc-utils/uuidd.service
|
||||
mount/Makefile
|
||||
partx/Makefile
|
||||
po/Makefile.in
|
||||
|
|
|
@ -18,3 +18,4 @@ wipefs
|
|||
findmnt
|
||||
lsblk
|
||||
lslocks
|
||||
uuidd.service
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
EXTRA_DIST = uuidd.rc
|
||||
|
||||
bin_PROGRAMS =
|
||||
sbin_PROGRAMS =
|
||||
usrsbin_exec_PROGRAMS =
|
||||
|
@ -89,7 +87,16 @@ if USE_SOCKET_ACTIVATION
|
|||
uuidd_SOURCES += sd-daemon.c
|
||||
uuidd_LDADD += -lrt
|
||||
endif
|
||||
if WITH_SYSTEMD
|
||||
systemdsystemunit_DATA = \
|
||||
uuidd.service \
|
||||
uuidd.socket
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST = uuidd.rc uuidd.service.in uuidd.socket
|
||||
CLEANFILES += uuidd.service
|
||||
|
||||
|
||||
if BUILD_LIBBLKID
|
||||
sbin_PROGRAMS += blkid findfs wipefs
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Daemon for generating UUIDs
|
||||
Requires=uuidd.socket
|
||||
|
||||
[Service]
|
||||
ExecStart=@sbindir@/uuidd -S -T 60
|
||||
Restart=no
|
||||
User=uuidd
|
||||
Group=uuidd
|
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=UUID daemon activation socket
|
||||
|
||||
[Socket]
|
||||
ListenStream=/var/run/uuidd/request
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
Loading…
Reference in New Issue