Bug 997954

Summary: retrace-server-interact <taskid> crash should set cwd=<retracedir>/taskid/misc directory for scratch files
Product: [Fedora] Fedora EPEL Reporter: Dave Wysochanski <dwysocha>
Component: retrace-serverAssignee: Michal Toman <mtoman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: jmoskovc, mtoman, pknirsch, rvokal
Target Milestone: ---Keywords: EasyFix, TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: retrace-server-1.10-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-22 18:25:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Wysochanski 2013-08-16 15:35:16 UTC
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):
retrace-server-1.9-6.el6.noarch

How reproducible:
Every time.

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

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

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 18:52:37 UTC
adding 'EasyFix' - feel free to remove if it gets complicated.

Comment 2 Michal Toman 2013-08-20 10:55:18 UTC
Fixed in upstream

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

    crashrc: append 'cd $MISCDIR'

Comment 3 Fedora Update System 2013-08-21 11:37:13 UTC
retrace-server-1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/retrace-server-1.10-1.el6

Comment 4 Fedora Update System 2013-08-21 19:01:23 UTC
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:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2013-11280/retrace-server-1.10-1.el6
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-08-22 18:25:34 UTC
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.