mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
Merge pull request #23647 from wjwithagen/wjw-fix-pidfile-err
common: be more informative if set PID-file fails Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
cf085103a8
@ -171,8 +171,14 @@ int pidfh::open(const ConfigProxy& conf)
|
||||
};
|
||||
int r = ::fcntl(pf_fd, F_SETLK, &l);
|
||||
if (r < 0) {
|
||||
derr << __func__ << ": failed to lock pidfile "
|
||||
<< pf_path << " because another process locked it." << dendl;
|
||||
if (errno == EAGAIN || errno == EACCES) {
|
||||
derr << __func__ << ": failed to lock pidfile "
|
||||
<< pf_path << " because another process locked it"
|
||||
<< "': " << cpp_strerror(errno) << dendl;
|
||||
} else {
|
||||
derr << __func__ << ": failed to lock pidfile "
|
||||
<< pf_path << "': " << cpp_strerror(errno) << dendl;
|
||||
}
|
||||
::close(pf_fd);
|
||||
reset();
|
||||
return -errno;
|
||||
|
Loading…
Reference in New Issue
Block a user