diff options
author | Ondrej Kozina <okozina@redhat.com> | 2015-05-14 15:43:43 +0200 |
---|---|---|
committer | Ondrej Kozina <okozina@redhat.com> | 2015-05-15 20:31:36 +0200 |
commit | f653b123cf41751ebabfc910061c07e6e3c47149 (patch) | |
tree | 6cfde4f4067226774c4df07a5471920a90e047a0 /libdaemon/server | |
parent | c0d30da60968e202d1e834dea28869a571bee991 (diff) | |
download | lvm2-f653b123cf41751ebabfc910061c07e6e3c47149.tar.gz |
libdaemon: suggest daemon already running
when dm_creat_lockfile fails, it's probably due to
another instance is holding the same pid file...
Diffstat (limited to 'libdaemon/server')
-rw-r--r-- | libdaemon/server/daemon-server.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |