From f653b123cf41751ebabfc910061c07e6e3c47149 Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Thu, 14 May 2015 15:43:43 +0200 Subject: [PATCH] libdaemon: suggest daemon already running when dm_creat_lockfile fails, it's probably due to another instance is holding the same pid file... --- libdaemon/server/daemon-server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index e1a9da9c5..6e497b8cc 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -568,8 +568,10 @@ void daemon_start(daemon_state s) * NB. Take care to not keep stale locks around. Best not exit(...) * after this point. */ - if (dm_create_lockfile(s.pidfile) == 0) + if (dm_create_lockfile(s.pidfile) == 0) { + ERROR(&s, "Failed to acquire lock on %s. Already running?\n", s.pidfile); exit(EXIT_ALREADYRUNNING); + } (void) dm_prepare_selinux_context(NULL, 0); }