Skip to content

Commit

Permalink
Merge pull request #49314 from SUSE/wip-tserong-qa-crash-chown
Browse files Browse the repository at this point in the history
qa/workunits/rados/test_crash: chown crash files to ceph user
  • Loading branch information
ljflores committed Jan 25, 2023
2 parents 6d41bdb + d139f6d commit 65fb727
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qa/workunits/rados/test_crash.sh
Expand Up @@ -24,6 +24,11 @@ for f in $(find $TESTDIR/archive/coredump -type f); do
fi
done

# ceph-crash runs as the unprivileged "ceph" user, but when under test
# the ceph osd daemons are running as root, so their crash files aren't
# readable. let's chown them so they behave as they would in real life.
sudo chown -R ceph:ceph /var/lib/ceph/crash

# let daemon find crashdumps on startup
sudo systemctl restart ceph-crash
sleep 30
Expand Down
3 changes: 3 additions & 0 deletions src/ceph-crash.in
Expand Up @@ -66,6 +66,9 @@ def post_crash(path):
def scrape_path(path):
for p in os.listdir(path):
crashpath = os.path.join(path, p)
if not os.access(crashpath, os.R_OK):
log.warning('unable to read crash path %s' % (crashpath))
continue
metapath = os.path.join(crashpath, 'meta')
donepath = os.path.join(crashpath, 'done')
if os.path.isfile(metapath):
Expand Down

0 comments on commit 65fb727

Please sign in to comment.