diff options
| author | Alan Conway <aconway@apache.org> | 2012-05-14 19:45:04 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-05-14 19:45:04 +0000 |
| commit | e2f6e40815750efad663d7dc4d0aa8ffdff2bb11 (patch) | |
| tree | caeb322fc9ebf5b3575d72eac9412301745f9e2e /cpp | |
| parent | 800a777fac0fa21a2bc44e0f97f054f85100a21b (diff) | |
| download | qpid-python-e2f6e40815750efad663d7dc4d0aa8ffdff2bb11.tar.gz | |
NO-JIRA: Reduce message for missing lock file from critical to notice.
If qpidd -q can't find the lock file, it used to issue a critical error message.
This is to harsh, not finding the lock file usually just means the broker isn't running.
Demoted to a notice message.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1338365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/posix/QpiddBroker.cpp | 10 | ||||
| -rwxr-xr-x | cpp/src/qpid/sys/posix/LockFile.cpp | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/posix/QpiddBroker.cpp b/cpp/src/posix/QpiddBroker.cpp index fd2fb6184f..76e3bb6674 100644 --- a/cpp/src/posix/QpiddBroker.cpp +++ b/cpp/src/posix/QpiddBroker.cpp @@ -154,8 +154,14 @@ int QpiddBroker::execute (QpiddOptions *options) { throw Exception("Internal error obtaining platform options"); if (myOptions->daemon.check || myOptions->daemon.quit) { - pid_t pid = Daemon::getPid(myOptions->daemon.piddir, - options->broker.port); + pid_t pid; + try { + pid = Daemon::getPid(myOptions->daemon.piddir, options->broker.port); + } catch (const ErrnoException& e) { + // This is not a critical error, usually means broker is not running + QPID_LOG(notice, "Cannot stop broker: " << e.what()); + return 1; + } if (pid < 0) return 1; if (myOptions->daemon.check) diff --git a/cpp/src/qpid/sys/posix/LockFile.cpp b/cpp/src/qpid/sys/posix/LockFile.cpp index c1f1c37b47..9fdf83f1bd 100755 --- a/cpp/src/qpid/sys/posix/LockFile.cpp +++ b/cpp/src/qpid/sys/posix/LockFile.cpp @@ -46,7 +46,7 @@ LockFile::LockFile(const std::string& path_, bool create) errno = 0; int flags=create ? O_WRONLY|O_CREAT|O_NOFOLLOW : O_RDWR; int fd = ::open(path.c_str(), flags, 0644); - if (fd < 0) throw ErrnoException("Cannot open " + path, errno); + if (fd < 0) throw ErrnoException("Cannot open lock file " + path, errno); if (::lockf(fd, F_TLOCK, 0) < 0) { ::close(fd); throw ErrnoException("Cannot lock " + path, errno); |
