Bug 997954 - retrace-server-interact <taskid> crash should set cwd=<retracedir>/taskid/misc directory for scratch files
retrace-server-interact <taskid> crash should set cwd=<retracedir>/taskid/mis...
Product: Fedora EPEL
Classification: Fedora
Component: retrace-server (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michal Toman
Fedora Extras Quality Assurance
: EasyFix, TestCaseProvided
Depends On:
  Show dependency treegraph
Reported: 2013-08-16 11:35 EDT by Dave Wysochanski
Modified: 2015-03-22 20:42 EDT (History)
4 users (show)

See Also:
Fixed In Version: retrace-server-1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-22 14:25:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave Wysochanski 2013-08-16 11:35:16 EDT
Description of problem:
This should be easy to implement, and hopefully not controversial.  I will solicit feedback from others on the lists.

Request that when running retrace-server-interact <taskid> crash, it would change CWD to a 'scratch' area, then when exiting, return CWD to the current directory where it was invoked.

Why?  It's very common in the course of core analysis to create temporary files which are output of commands run during the analysis, or supporting files to the analysis (such as small scripts).  It would be good if once you run 'retrace-server-interact <task> crash' it would change the directory to a scratch area for that core (for now, we can use the 'misc' subdirectory off of the task directory).  It should facilitate sharing of information about the vmcore analysis and keep all the files in one place associated with the vmcore.  When the task is later removed, all these files can be cleaned up as well.

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

Steps to Reproduce:
$ retrace-server-interact 404564956 crash
crash> ^Z
[1]+  Stopped                 retrace-server-interact 404564956 crash
[dwysocha@optimus ~]$ pwd

Ideally CWD would be here:
[dwysocha@optimus ~]$ cd /cores/retrace/tasks/404564956/misc
[dwysocha@optimus misc]$ pwd

Here's an example of a command we might want to run.  Note I have to put the full path in there, or remember the 'cd /cores/retrace/tasks/404564956/misc' before issuing retrace-server-interact.  Otherwise, I have to do this inside crash:

crash> ps | grep \> | awk '{ print "bt "$2 }' > /cores/retrace/tasks/404564956/misc/bt-running.crash
crash> < /cores/retrace/tasks/404564956/misc/bt-running.crash > /cores/retrace/tasks/404564956/misc/bt-running.txt

I'd like to be able to do

crash> ps | grep \> | awk '{ print "bt "$2 }' > ./bt-running.crash
crash> < ./bt-running.crash > ./bt-running.txt

Actual results:
Running retrace-server-interact does not change CWD but the location of the scratch area may be a long path.

Expected results:
retrace-server-interact should change CWD to a scratch area so writing temporary files is easier.

Additional info:

I tried to think of downsides of changing the directory but did not come up with much.  It may not be expected to people that running the command would change CWD into a 'scratch' area for the vmcore, but I'm not sure how much people would care.
Comment 1 Dave Wysochanski 2013-08-16 14:52:37 EDT
adding 'EasyFix' - feel free to remove if it gets complicated.
Comment 2 Michal Toman 2013-08-20 06:55:18 EDT
Fixed in upstream

commit 21b66c1e80f80dea041d33d38409b4862a163829
Author: Michal Toman <mtoman@redhat.com>
Date:   Tue Aug 20 12:53:55 2013 +0200

    crashrc: append 'cd $MISCDIR'
Comment 3 Fedora Update System 2013-08-21 07:37:13 EDT
retrace-server-1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
Comment 4 Fedora Update System 2013-08-21 15:01:23 EDT
Package retrace-server-1.10-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing retrace-server-1.10-1.el6'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2013-08-22 14:25:34 EDT
retrace-server-1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.