All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] uuidd: require use of --socket-activation when run as systemd service
@ 2016-08-03 22:41 Sami Kerola
  2016-08-03 22:41 ` [PATCH 2/2] uuidd: remove unnecessary pidpile path variable Sami Kerola
  2016-08-08 10:22 ` [PATCH 1/2] uuidd: require use of --socket-activation when run as systemd service Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Sami Kerola @ 2016-08-03 22:41 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 misc-utils/uuidd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index a3fe830..77c967d 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
@@ -651,6 +651,13 @@ int main(int argc, char **argv)
 	else if (pidfile_path_param)
 		pidfile_path = pidfile_path_param;
 
+#ifdef HAVE_LIBSYSTEMD
+	if (getppid() == 1 && 0 < sd_booted() &&
+	    (!uuidd_cxt.no_sock || !uuidd_cxt.no_fork || !no_pid))
+		errx(EXIT_FAILURE,  _("cannot run as systemd service "
+				      "without --socket-activation"));
+#endif
+
 	/* custom socket path and socket-activation make no sense */
 	if (s_flag && uuidd_cxt.no_sock && !uuidd_cxt.quiet)
 		warnx(_("Both --socket-activation and --socket specified. "
-- 
2.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-12 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03 22:41 [PATCH 1/2] uuidd: require use of --socket-activation when run as systemd service Sami Kerola
2016-08-03 22:41 ` [PATCH 2/2] uuidd: remove unnecessary pidpile path variable Sami Kerola
2016-08-08 10:34   ` Karel Zak
2016-08-08 10:22 ` [PATCH 1/2] uuidd: require use of --socket-activation when run as systemd service Karel Zak
2016-08-12 21:29   ` Sami Kerola

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.