doc/index.html doc/index.rst doc/searchindex.js doc/_sources
by Adam Stokes
doc/_sources/index.txt | 56 ++++++++++++++++++++++++-----------------------
doc/index.html | 58 +++++++++++++++++++++++++------------------------
doc/index.rst | 50 +++++++++++++++++++++---------------------
doc/searchindex.js | 2 -
4 files changed, 86 insertions(+), 80 deletions(-)
New commits:
commit 10968dbf61a48647109f08a0a7005abfa1afe223
Author: adam stokes <ajs(a)redhat.com>
Date: Wed May 6 08:59:23 2009 -0400
- documentation finalizations, snippet information added.
this may need more work, but good enough for when .14 stable
is released.
diff --git a/doc/_sources/index.txt b/doc/_sources/index.txt
index 83c183c..51a1170 100644
--- a/doc/_sources/index.txt
+++ b/doc/_sources/index.txt
@@ -57,7 +57,7 @@ each section and describe its meaning::
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
- autoPurge=False
+ autoPurge=Yes
[advanced]
# crash_32=/usr/local/i386/crash
@@ -89,7 +89,7 @@ require smtp authentication.
``purgeLimit``: Define amount of day(s) back wish to keep physical data on
system.
-``autoPurge``: True/False setting if wanting cas-admin to auto purge stale data on
+``autoPurge``: Yes/No setting if wanting cas-admin to auto purge stale data on
each run.
``crash_32``: Primarily used on x86_64 systems to process x86 cores. If x86
@@ -134,7 +134,7 @@ following::
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
- autoPurge=False
+ autoPurge=Yes
[advanced]
crash_32=/usr/local/i386/crash
@@ -177,11 +177,11 @@ An example, of a user wanting to process a corefile named ``vmcore.12345``::
$ cas -i 12345 -f vmcore.12345 -e user(a)cas-server.com
-In the above example an assumption is made that ``12345`` is associated to some
+In the above example an assumption is made that ``1`` is associated to some
form of ticketing system so to keep things organized an identifier was set of
that number.
-The directory hierarchy for the current job should look like ``/cores/12345``.
+The directory hierarchy for the current job should look like ``/cores/1``.
In addition to the processing of core files there is also a ``process log`` contained
within this directory for each job processed. If multiple jobs for the same identifier
are issued they are placed within a sub directory marked by the current timestamp
@@ -204,10 +204,10 @@ Analyzing
Continuing with the previous example the results of CAS processing should be emailed
and look something similar to::
- Subject: CAS results for 12345
- Date: Wed, 11 Feb 2009 08:44:37 -0500
+ Subject: CAS results for 1
+ Date: Tue, 06 May 2009 08:41:20 -0500
- Location: /cores/processed/12345/02.11.09.08.44.19
+ Location: Location: /cores/1/2009.05.06.08.41.20
Server: x86_64.cas-server.com
Output data:
PID: 0 TASK: ffffffff803e9b80 CPU: 0 COMMAND: "swapper"
@@ -250,7 +250,7 @@ and look something similar to::
... snip ...
-From this email a ``location`` is provided ``/cores/processed/12345/02.11.09.08.44.19``
+From this email a ``location`` is provided ``Location: /cores/1/2009.05.06.08.41.20``
and the server in which further analyzation can be continued ``x86_64.cas-server.com``.
Normally from a support perspective this email should contain enough information
@@ -262,11 +262,11 @@ Logging into the stated server and changing into the directory defined several
files are presented::
$ pwd
- /cores/processed/12345/02.11.09.08.44.19
+ Location: /cores/1/2009.05.06.08.41.20
$ ls
- 12345.log crash crash.in crash.out usr vmcore.12345
+ 1.log crash crash.in crash.out usr vmcore.12345 log memory modules sys traceback
-``12345.log``: contains any informational messages presented during the processing
+``1.log``: contains any informational messages presented during the processing
of the core. Everything from informational to debug statements are provided here.
``crash``: a script autogenerated to provide an automated way of gathering intial
@@ -277,31 +277,33 @@ crash wrapper in its original form::
#!/bin/sh
/usr/bin/crash \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- -s < /cores/processed/12345/02.11.09.08.44.19/crash.in
+ /cores/1/2009.05.06.08.41.20/vmcore.12345 \
+ usr/*/*/*/*/2.6.9*largesmp/vmlinux $*
-In order to remove automation the redirect from crash.in needs to be removed::
-
- #!/bin/sh
- /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux
+``Note`` Running the crash wrapper manually will result in an interactive instance.
**Alternative to using the crash wrapper**
It is possible to specify the vmlinux and corefile with crash on the command line::
- $ crash /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345
+ $ crash /cores/1/2009.05.06.08.41.20/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ /cores/1/2009.05.06.08.41.20/vmcore.12345
``crash.in``: a list of commands to be read into crash during the automated
analysis::
- bt -a >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- sys >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- log >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- mod >>/cores/processed/12345/02.11.09.08.44.19/crash.out
+ bt >> traceback
+ bt -a >> traceback
+ sys >> sys
+ sys -c >> sys
+ log >> log
+ mod >> modules
+ kmem >> memory
+ kmem -f >> memory
exit
+
+This can be extended by adding more snippets into ``/var/lib/cas/snippets``. Please see
+that directory for examples.
``crash.out``: output of initial crash analysis and the same data which
is sent in an email if defined.
@@ -309,7 +311,7 @@ is sent in an email if defined.
``usr``: directory structure from the extraction of the vmlinux file
from the associated kernel-debuginfo rpm for use within crash::
- /cores/processed/12345/02.11.09.08.44.19/
+ /cores/1/2009.05.06.08.41.20/
usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux
``vmcore.12345``: corefile from which was either defined or extracted from
diff --git a/doc/index.html b/doc/index.html
index 8d12fc9..8856c99 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -86,7 +86,7 @@ mailServer=mail.example.com
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
-autoPurge=False
+autoPurge=Yes
[advanced]
# crash_32=/usr/local/i386/crash</pre>
</div>
@@ -110,7 +110,7 @@ require smtp authentication.</p>
<p><tt class="docutils literal"><span class="pre">database</span></tt>: (<strong>Required</strong>) Define where the sqlite database will reside.</p>
<p><tt class="docutils literal"><span class="pre">purgeLimit</span></tt>: Define amount of day(s) back wish to keep physical data on
system.</p>
-<p><tt class="docutils literal"><span class="pre">autoPurge</span></tt>: True/False setting if wanting cas-admin to auto purge stale data on
+<p><tt class="docutils literal"><span class="pre">autoPurge</span></tt>: Yes/No setting if wanting cas-admin to auto purge stale data on
each run.</p>
<p><tt class="docutils literal"><span class="pre">crash_32</span></tt>: Primarily used on x86_64 systems to process x86 cores. If x86
version of crash is installed this directive can be set to the crash binary
@@ -149,7 +149,7 @@ mailServer=mail.cas-server.com
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
-autoPurge=False
+autoPurge=Yes
[advanced]
crash_32=/usr/local/i386/crash</pre>
</div>
@@ -186,10 +186,10 @@ CAS simply pass it the email parameter.</p>
<p>An example, of a user wanting to process a corefile named <tt class="docutils literal"><span class="pre">vmcore.12345</span></tt>:</p>
<div class="highlight-python"><pre>$ cas -i 12345 -f vmcore.12345 -e user(a)cas-server.com</pre>
</div>
-<p>In the above example an assumption is made that <tt class="docutils literal"><span class="pre">12345</span></tt> is associated to some
+<p>In the above example an assumption is made that <tt class="docutils literal"><span class="pre">1</span></tt> is associated to some
form of ticketing system so to keep things organized an identifier was set of
that number.</p>
-<p>The directory hierarchy for the current job should look like <tt class="docutils literal"><span class="pre">/cores/12345</span></tt>.
+<p>The directory hierarchy for the current job should look like <tt class="docutils literal"><span class="pre">/cores/1</span></tt>.
In addition to the processing of core files there is also a <tt class="docutils literal"><span class="pre">process</span> <span class="pre">log</span></tt> contained
within this directory for each job processed. If multiple jobs for the same identifier
are issued they are placed within a sub directory marked by the current timestamp
@@ -209,10 +209,10 @@ the core.</p>
<h2>Analyzing<a class="headerlink" href="#analyzing" title="Permalink to this headline">¶</a></h2>
<p>Continuing with the previous example the results of CAS processing should be emailed
and look something similar to:</p>
-<div class="highlight-python"><pre>Subject: CAS results for 12345
-Date: Wed, 11 Feb 2009 08:44:37 -0500
+<div class="highlight-python"><pre>Subject: CAS results for 1
+Date: Tue, 06 May 2009 08:41:20 -0500
-Location: /cores/processed/12345/02.11.09.08.44.19
+Location: Location: /cores/1/2009.05.06.08.41.20
Server: x86_64.cas-server.com
Output data:
PID: 0 TASK: ffffffff803e9b80 CPU: 0 COMMAND: "swapper"
@@ -255,7 +255,7 @@ PID: 6122 TASK: 101f3658030 CPU: 2 COMMAND: "gfs_quotad"
... snip ...</pre>
</div>
-<p>From this email a <tt class="docutils literal"><span class="pre">location</span></tt> is provided <tt class="docutils literal"><span class="pre">/cores/processed/12345/02.11.09.08.44.19</span></tt>
+<p>From this email a <tt class="docutils literal"><span class="pre">location</span></tt> is provided <tt class="docutils literal"><span class="pre">Location:</span> <span class="pre">/cores/1/2009.05.06.08.41.20</span></tt>
and the server in which further analyzation can be continued <tt class="docutils literal"><span class="pre">x86_64.cas-server.com</span></tt>.</p>
<p>Normally from a support perspective this email should contain enough information
for a kernel engineer to begin debugging the problem. Assuming more is needed
@@ -264,11 +264,11 @@ to access this data.</p>
<p>Logging into the stated server and changing into the directory defined several
files are presented:</p>
<div class="highlight-python"><pre>$ pwd
-/cores/processed/12345/02.11.09.08.44.19
+Location: /cores/1/2009.05.06.08.41.20
$ ls
-12345.log crash crash.in crash.out usr vmcore.12345</pre>
+1.log crash crash.in crash.out usr vmcore.12345 log memory modules sys traceback</pre>
</div>
-<p><tt class="docutils literal"><span class="pre">12345.log</span></tt>: contains any informational messages presented during the processing
+<p><tt class="docutils literal"><span class="pre">1.log</span></tt>: contains any informational messages presented during the processing
of the core. Everything from informational to debug statements are provided here.</p>
<p><tt class="docutils literal"><span class="pre">crash</span></tt>: a script autogenerated to provide an automated way of gathering intial
data from the coredump. <tt class="docutils literal"><span class="pre">Note</span></tt> if wanting to use this crash wrapper in a more
@@ -276,33 +276,35 @@ manual approach some alterations to the script need to occur.</p>
<p>crash wrapper in its original form:</p>
<div class="highlight-python"><pre>#!/bin/sh
/usr/bin/crash \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- -s < /cores/processed/12345/02.11.09.08.44.19/crash.in</pre>
-</div>
-<p>In order to remove automation the redirect from crash.in needs to be removed:</p>
-<div class="highlight-python"><pre>#!/bin/sh
- /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux</pre>
+ /cores/1/2009.05.06.08.41.20/vmcore.12345 \
+ usr/*/*/*/*/2.6.9*largesmp/vmlinux $*</pre>
</div>
+<p><tt class="docutils literal"><span class="pre">Note</span></tt> Running the crash wrapper manually will result in an interactive instance.</p>
<p><strong>Alternative to using the crash wrapper</strong></p>
<p>It is possible to specify the vmlinux and corefile with crash on the command line:</p>
-<div class="highlight-python"><pre>$ crash /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345</pre>
+<div class="highlight-python"><pre>$ crash /cores/1/2009.05.06.08.41.20/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ /cores/1/2009.05.06.08.41.20/vmcore.12345</pre>
</div>
<p><tt class="docutils literal"><span class="pre">crash.in</span></tt>: a list of commands to be read into crash during the automated
analysis:</p>
-<div class="highlight-python"><pre>bt -a >>/cores/processed/12345/02.11.09.08.44.19/crash.out
-sys >>/cores/processed/12345/02.11.09.08.44.19/crash.out
-log >>/cores/processed/12345/02.11.09.08.44.19/crash.out
-mod >>/cores/processed/12345/02.11.09.08.44.19/crash.out
-exit</pre>
+<div class="highlight-python"><div class="highlight"><pre><span class="n">bt</span> <span class="o">>></span> <span class="n">traceback</span>
+<span class="n">bt</span> <span class="o">-</span><span class="n">a</span> <span class="o">>></span> <span class="n">traceback</span>
+<span class="n">sys</span> <span class="o">>></span> <span class="n">sys</span>
+<span class="n">sys</span> <span class="o">-</span><span class="n">c</span> <span class="o">>></span> <span class="n">sys</span>
+<span class="n">log</span> <span class="o">>></span> <span class="n">log</span>
+<span class="n">mod</span> <span class="o">>></span> <span class="n">modules</span>
+<span class="n">kmem</span> <span class="o">>></span> <span class="n">memory</span>
+<span class="n">kmem</span> <span class="o">-</span><span class="n">f</span> <span class="o">>></span> <span class="n">memory</span>
+<span class="nb">exit</span>
+</pre></div>
</div>
+<p>This can be extended by adding more snippets into <tt class="docutils literal"><span class="pre">/var/lib/cas/snippets</span></tt>. Please see
+that directory for examples.</p>
<p><tt class="docutils literal"><span class="pre">crash.out</span></tt>: output of initial crash analysis and the same data which
is sent in an email if defined.</p>
<p><tt class="docutils literal"><span class="pre">usr</span></tt>: directory structure from the extraction of the vmlinux file
from the associated kernel-debuginfo rpm for use within crash:</p>
-<div class="highlight-python"><pre>/cores/processed/12345/02.11.09.08.44.19/
+<div class="highlight-python"><pre>/cores/1/2009.05.06.08.41.20/
usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux</pre>
</div>
<p><tt class="docutils literal"><span class="pre">vmcore.12345</span></tt>: corefile from which was either defined or extracted from
diff --git a/doc/index.rst b/doc/index.rst
index b380b4d..51a1170 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -177,11 +177,11 @@ An example, of a user wanting to process a corefile named ``vmcore.12345``::
$ cas -i 12345 -f vmcore.12345 -e user(a)cas-server.com
-In the above example an assumption is made that ``12345`` is associated to some
+In the above example an assumption is made that ``1`` is associated to some
form of ticketing system so to keep things organized an identifier was set of
that number.
-The directory hierarchy for the current job should look like ``/cores/12345``.
+The directory hierarchy for the current job should look like ``/cores/1``.
In addition to the processing of core files there is also a ``process log`` contained
within this directory for each job processed. If multiple jobs for the same identifier
are issued they are placed within a sub directory marked by the current timestamp
@@ -204,10 +204,10 @@ Analyzing
Continuing with the previous example the results of CAS processing should be emailed
and look something similar to::
- Subject: CAS results for 12345
- Date: Wed, 11 Feb 2009 08:44:37 -0500
+ Subject: CAS results for 1
+ Date: Tue, 06 May 2009 08:41:20 -0500
- Location: /cores/processed/12345/02.11.09.08.44.19
+ Location: Location: /cores/1/2009.05.06.08.41.20
Server: x86_64.cas-server.com
Output data:
PID: 0 TASK: ffffffff803e9b80 CPU: 0 COMMAND: "swapper"
@@ -250,7 +250,7 @@ and look something similar to::
... snip ...
-From this email a ``location`` is provided ``/cores/processed/12345/02.11.09.08.44.19``
+From this email a ``location`` is provided ``Location: /cores/1/2009.05.06.08.41.20``
and the server in which further analyzation can be continued ``x86_64.cas-server.com``.
Normally from a support perspective this email should contain enough information
@@ -262,11 +262,11 @@ Logging into the stated server and changing into the directory defined several
files are presented::
$ pwd
- /cores/processed/12345/02.11.09.08.44.19
+ Location: /cores/1/2009.05.06.08.41.20
$ ls
- 12345.log crash crash.in crash.out usr vmcore.12345
+ 1.log crash crash.in crash.out usr vmcore.12345 log memory modules sys traceback
-``12345.log``: contains any informational messages presented during the processing
+``1.log``: contains any informational messages presented during the processing
of the core. Everything from informational to debug statements are provided here.
``crash``: a script autogenerated to provide an automated way of gathering intial
@@ -277,31 +277,33 @@ crash wrapper in its original form::
#!/bin/sh
/usr/bin/crash \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- -s < /cores/processed/12345/02.11.09.08.44.19/crash.in
+ /cores/1/2009.05.06.08.41.20/vmcore.12345 \
+ usr/*/*/*/*/2.6.9*largesmp/vmlinux $*
-In order to remove automation the redirect from crash.in needs to be removed::
-
- #!/bin/sh
- /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
- /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux
+``Note`` Running the crash wrapper manually will result in an interactive instance.
**Alternative to using the crash wrapper**
It is possible to specify the vmlinux and corefile with crash on the command line::
- $ crash /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
- /cores/processed/12345/02.11.09.08.44.19/vmcore.12345
+ $ crash /cores/1/2009.05.06.08.41.20/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ /cores/1/2009.05.06.08.41.20/vmcore.12345
``crash.in``: a list of commands to be read into crash during the automated
analysis::
- bt -a >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- sys >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- log >>/cores/processed/12345/02.11.09.08.44.19/crash.out
- mod >>/cores/processed/12345/02.11.09.08.44.19/crash.out
+ bt >> traceback
+ bt -a >> traceback
+ sys >> sys
+ sys -c >> sys
+ log >> log
+ mod >> modules
+ kmem >> memory
+ kmem -f >> memory
exit
+
+This can be extended by adding more snippets into ``/var/lib/cas/snippets``. Please see
+that directory for examples.
``crash.out``: output of initial crash analysis and the same data which
is sent in an email if defined.
@@ -309,7 +311,7 @@ is sent in an email if defined.
``usr``: directory structure from the extraction of the vmlinux file
from the associated kernel-debuginfo rpm for use within crash::
- /cores/processed/12345/02.11.09.08.44.19/
+ /cores/1/2009.05.06.08.41.20/
usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux
``vmcore.12345``: corefile from which was either defined or extracted from
diff --git a/doc/searchindex.js b/doc/searchindex.js
index 7241f0c..dbffc5d 100644
--- a/doc/searchindex.js
+++ b/doc/searchindex.js
@@ -1 +1 @@
-Search.setIndex({desctypes:{},terms:{all:0,mnt:0,snip:0,abil:0,follow:0,disk:0,depend:0,wish:0,do_dlm_lock:0,those:0,aris:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,fals:0,faq:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,prepar:0,pleas:0,x86_64:0,core:0,direct:0,pass:0,download:0,further:0,sub:0,section:0,abl:0,access:0,version:0,autogener:0,gener:0,here:0,address:0,path:0,sinc:0,valu:0,ffffffff80110bf5:0,rdx:0,amount:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,via:0,repositori:0,modul:0,prefer:0,crash_32:0,filenam:0,instal:0,feb:0,describ:0,would:0,prove:0,doubl:0,visit:0,two:0,next:0,few:0,usr:0,recommend:0,type:0,tell:0,more:0,sort:0,share:0,ffffffff803e9b80:0,ffffffff8010e81c:0,must:0,retriev:0,hous:0,setup:0,work:0,uniqu:0,can:0,root:0,sqlite:0,tar:0,process:0,smtp:0,accept:0,want:0,occur:0,multipl:0,anoth:0,how:0,error_exit:0,purg:0,opt:0,verifi:0,perspect:0,ffffffff80528000:0,resourc:0,"00000102000a4780":0,clone:0,reflect:0,mai:0,data:0,physic:0,fedora:0,essenti:0,issu:0,inform:0,environ:0,media:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,requir:0,mail:0,main:0,alter:0,messag:0,crash:0,than:0,python:0,auto:0,overal:0,dai:0,initi:0,"break":0,mention:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,kern:0,easili:0,each:0,debug:0,mean:0,continu:0,happen:0,extract:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,ffffffff8011d191:0,content:0,fffffffffffffffa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,keep:0,vmlinux:0,thing:0,place:0,isn:0,assign:0,first:0,origin:0,rang:0,onc:0,number:0,swapper:0,instruct:0,done:0,wrapper:0,rflag:0,differ:0,script:0,associ:0,system:0,least:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,boil:0,editor:0,option:0,debuginfo:0,tool:0,specifi:0,hassl:0,exactli:0,rsp:0,corefil:0,provid:0,remov:0,emac:0,structur:0,store:0,stale:0,ani:0,fail:0,have:0,call_function_interrupt:0,"101f3658030":0,rax:0,rsi:0,packag:0,date:0,bz2:0,lib:0,note:0,also:0,build:0,which:0,begin:0,normal:0,previou:0,compress:0,most:0,regular:0,deploi:0,"101f21efb80":0,gather:0,yum:0,determin:0,irq:0,usual:0,show:0,text:0,find:0,redirect:0,current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,mainten:0,ellargesmp:0,enabl:0,organ:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,see:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,purgelimit:0,databas:0,someth:0,enough:0,approach:0,email:0,altern:0,assumpt:0,cpu_idl:0,default_idl:0,job:0,come:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,coredump:0,"101f21efb50":0,mark:0,much:0,popul:0,quickli:0,largesmp:0,anywher:0,try_crashdump:0,"0000000000000e86":0,func:0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,rbp:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,need:0,archiv:0,uncom:0,conf:0,fedorahost:0,sever:0,thei:0,suggest:0,same:0,binari:0,timestamp:0,x86:0,temporari:0,user:0,"500gb":0,engin:0,stack:0,task:0,"10001073e98":0,do_invalid_op:0,exampl:0,command:0,thi:0,filesystem:0,gzip:0,everyth:0,latest:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,wed:0,except:0,valid:0,match:0,bin:0,read:0,debuglevel:0,mod:0,"1000107bfa0":0,resid:0,like:0,specif:0,anyon:0,manual:0,resolv:0,server:0,collect:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,some:0,back:0,gfs_quotad:0,proper:0,tmp:0,mailserv:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,intial:0,who:0,run:0,reach:0,usag:0,prerequisit:0,from:0,unfortun:0,primarili:0,within:0,automat:0,down:0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,support:0,question:0,avail:0,includ:0,suit:0,"var":0,rhel:0,analysi:0,properli:0,form:0,pwd:0,line:0,"true":0,analyst:0,info:0,made:0,possibl:0,checkout:0,below:0,ffffffff80111c90:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,other:0,ffffffff8010e7a9:0,architectur:0,benefici:0,autopurg:0,ffffffff80529fb8:0,directori:0,descript:0,"1tb":0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
+Search.setIndex({desctypes:{},terms:{all:0,mnt:0,snip:0,abil:0,follow:0,disk:0,depend:0,wish:0,do_dlm_lock:0,those:0,aris:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,fals:[],faq:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,prepar:0,pleas:0,x86_64:0,core:0,direct:0,pass:0,download:0,further:0,sub:0,section:0,abl:0,access:0,version:0,autogener:0,gener:0,here:0,address:0,path:0,sinc:0,valu:0,ffffffff80110bf5:0,rdx:0,amount:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,via:0,repositori:0,modul:0,prefer:0,crash_32:0,filenam:0,instal:0,feb:[],describ:0,would:0,prove:0,doubl:0,visit:0,two:0,next:0,few:0,usr:0,recommend:0,type:0,tell:0,more:0,sort:0,share:0,ffffffff803e9b80:0,ffffffff8010e81c:0,must:0,retriev:0,hous:0,setup:0,work:0,uniqu:0,can:0,root:0,sqlite:0,tar:0,process:0,smtp:0,accept:0,want:0,occur:0,multipl:0,anoth:0,snippet:0,how:0,error_exit:0,purg:0,opt:0,verifi:0,perspect:0,ffffffff80528000:0,resourc:0,"00000102000a4780":0,clone:0,reflect:0,mai:0,data:0,physic:0,fedora:0,essenti:0,issu:0,inform:0,environ:0,media:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,requir:0,mail:0,main:0,alter:0,messag:0,crash:0,than:0,python:0,auto:0,overal:0,dai:0,initi:0,"break":0,mention:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,kern:0,easili:0,each:0,debug:0,mean:0,continu:0,happen:0,extract:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,ffffffff8011d191:0,content:0,fffffffffffffffa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,traceback:0,keep:0,vmlinux:0,thing:0,place:0,isn:0,assign:0,first:0,origin:0,rang:0,onc:0,number:0,swapper:0,instruct:0,done:0,wrapper:0,rflag:0,differ:0,script:0,associ:0,interact:0,system:0,least:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,boil:0,editor:0,option:0,debuginfo:0,tool:0,specifi:0,hassl:0,exactli:0,rsp:0,corefil:0,provid:0,remov:[],emac:0,structur:0,store:0,stale:0,ani:0,fail:0,have:0,call_function_interrupt:0,"101f3658030":0,rax:0,rsi:0,packag:0,date:0,bz2:0,lib:0,note:0,also:0,build:0,which:0,begin:0,normal:0,previou:0,compress:0,most:0,regular:0,deploi:0,"101f21efb80":0,gather:0,yum:0,determin:0,irq:0,usual:0,show:0,text:0,find:0,redirect:[],current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,mainten:0,ellargesmp:0,enabl:0,organ:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,see:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,purgelimit:0,databas:0,someth:0,enough:0,approach:0,email:0,altern:0,assumpt:0,extend:0,cpu_idl:0,default_idl:0,job:0,come:0,tue:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,coredump:0,"101f21efb50":0,mark:0,much:0,popul:0,quickli:0,largesmp:0,anywher:0,try_crashdump:0,"0000000000000e86":0,func:0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,rbp:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,need:0,archiv:0,uncom:0,conf:0,fedorahost:0,sever:0,thei:0,suggest:0,same:0,binari:0,timestamp:0,x86:0,temporari:0,user:0,"500gb":0,engin:0,stack:0,task:0,"10001073e98":0,do_invalid_op:0,exampl:0,command:0,thi:0,filesystem:0,gzip:0,everyth:0,latest:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,wed:[],except:0,add:[],valid:0,match:0,bin:0,read:0,kmem:0,debuglevel:0,mod:0,"1000107bfa0":0,resid:0,like:0,specif:0,anyon:0,manual:0,resolv:0,server:0,collect:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,some:0,back:0,gfs_quotad:0,proper:0,tmp:0,mailserv:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,intial:0,who:0,run:0,reach:0,usag:0,prerequisit:0,from:0,memori:0,unfortun:0,primarili:0,within:0,automat:0,down:0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,support:0,question:0,avail:0,includ:0,suit:0,"var":0,rhel:0,analysi:0,properli:0,form:0,pwd:0,line:0,"true":[],analyst:0,info:0,made:0,possibl:0,checkout:0,below:0,ffffffff80111c90:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,other:0,ffffffff8010e7a9:0,architectur:0,benefici:0,autopurg:0,ffffffff80529fb8:0,directori:0,descript:0,"1tb":0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
14 years, 12 months
doc/genindex.html doc/index.html doc/index.rst doc/objects.inv doc/search.html doc/searchindex.js doc/_sources doc/_static
by Adam Stokes
doc/_sources/index.txt | 72 +++---
doc/_static/basic.css | 414 +++++++++++++++++++++++++++++++++++
doc/_static/default.css | 528 +++------------------------------------------
doc/_static/doctools.js | 4
doc/_static/searchtools.js | 4
doc/genindex.html | 40 ++-
doc/index.html | 109 +++++----
doc/index.rst | 8
doc/objects.inv | 4
doc/search.html | 28 +-
doc/searchindex.js | 2
11 files changed, 608 insertions(+), 605 deletions(-)
New commits:
commit 9e6d0a6887bf8b9556e20886f020fc949879c3b3
Author: adam stokes <ajs(a)redhat.com>
Date: Wed May 6 08:21:31 2009 -0400
- documentation update
diff --git a/doc/_sources/index.txt b/doc/_sources/index.txt
index 418e0ab..83c183c 100644
--- a/doc/_sources/index.txt
+++ b/doc/_sources/index.txt
@@ -1,11 +1,11 @@
-.. image:: cas_logo.png
-
Core Analysis System
====================
Introduction
------------
+.. image:: cas_logo.png
+
Description
^^^^^^^^^^^
@@ -16,7 +16,7 @@ types to core dumps are automatically detected and processed.
Prerequisites
^^^^^^^^^^^^^
-CAS needs at least **Python 2.4** to run. For systems that are not running
+CAS needs at least **Python 2.3** to run. For systems that are not running
Fedora 9 or later (this would include RHEL 4/5) the EPEL repo needs to be
installed. Visit `EPEL <https://fedoraproject.org/wiki/EPEL>`_ to enable
this repository.
@@ -27,16 +27,19 @@ can easily be installed via `yum`::
$ yum install func
-Storage size can be determined based on how many kernel-debuginfo to be stored
-and how many core dumps and their filesize will be processed. Typically, it is
-recommended for at least 1TB for cores and another 500GB for debuginfo's.
+The amount of storage needed can be determined base on the following
+information:
+
+- The number of kernel-debuginfo packages needed
+- How many core dumps will be processed.
+
+Typically it is recommended to have at least 1TB for cores and another 500GB for
+the debuginfo packages.
Since analyzing cores requires the same architecture specific systems the core
was generated on there will need to be systems available of those same types
in order for analyzation to work properly.
-Finally, root access to the CAS server.
-
Configuration
^^^^^^^^^^^^^
@@ -46,14 +49,15 @@ each section and describe its meaning::
[settings]
kernels=/mnt/kernels
- rpms=/var/db/cas/rpms.db
- rpmFilter=.*kernel-debuginfo-[0-9].*\.rpm
+ rpmFilter=.*kerne.+-debuginfo-[0-9].*\.rpm
debugs=/cores/debugs
debugLevel=DEBUG
workDirectory=/cores/processed
- servers=/var/db/cas/servers.db
- jobs=/var/db/cas/jobs.db
mailServer=mail.example.com
+ database=/var/db/cas/cas.db
+ [maintenance]
+ purgeLimit=90
+ autoPurge=False
[advanced]
# crash_32=/usr/local/i386/crash
@@ -61,9 +65,6 @@ each section and describe its meaning::
stored. This can range anywhere from an nfs mount, samba share, local disk or
any other type of media the cas server can access.
-``rpms``: (**Required**) Database which houses the processing of kernel-debuginfo and stores the
-necessary information for CAS to properly match core dumps.
-
``rpmFilters``: (**Required**) This is a emacs based regular expression which is essentially
passed to a find command to locate the various kernel-debuginfo packages defined
in ``kernels`` directive.
@@ -79,16 +80,18 @@ Currently the only accepted values are ``DEBUG|INFO``.
point will need to have the most storage assigned to it. Depending on how many
cores are processed in a given timeframe this area will fill up quickly.
-``servers``: If func is installed and configured all associated servers will
-be stored here.
-
-``jobs``: Contains information on current jobs being processed and eventually
-what jobs are in the queue.
-
``mailServer``: If wanting output of CAS processing email to a certain address
this directive needs to be set. ``Note`` that the mail server should not
require smtp authentication.
+``database``: (**Required**) Define where the sqlite database will reside.
+
+``purgeLimit``: Define amount of day(s) back wish to keep physical data on
+system.
+
+``autoPurge``: True/False setting if wanting cas-admin to auto purge stale data on
+each run.
+
``crash_32``: Primarily used on x86_64 systems to process x86 cores. If x86
version of crash is installed this directive can be set to the crash binary
and CAS will automatically process x86 cores on a x86_64 machine. ``Note`` this
@@ -123,14 +126,15 @@ following::
[settings]
kernels=/mnt/kernels
- rpms=/var/db/cas/rpms.db
- rpmFilter=.*kernel-debuginfo-[0-9].*\.rpm
+ rpmFilter=.*kerne.+-debuginfo-[0-9].*\.rpm
debugs=/tmp
debugLevel=DEBUG
workDirectory=/cores
- servers=/var/db/cas/servers.db
- jobs=/var/db/cas/jobs.db
mailServer=mail.cas-server.com
+ database=/var/db/cas/cas.db
+ [maintenance]
+ purgeLimit=90
+ autoPurge=False
[advanced]
crash_32=/usr/local/i386/crash
@@ -204,7 +208,7 @@ and look something similar to::
Date: Wed, 11 Feb 2009 08:44:37 -0500
Location: /cores/processed/12345/02.11.09.08.44.19
- Server: test-2.gss.redhat.com
+ Server: x86_64.cas-server.com
Output data:
PID: 0 TASK: ffffffff803e9b80 CPU: 0 COMMAND: "swapper"
#0 [ffffffff8047a0a0] smp_call_function_interrupt at ffffffff8011d191
@@ -247,7 +251,7 @@ and look something similar to::
... snip ...
From this email a ``location`` is provided ``/cores/processed/12345/02.11.09.08.44.19``
-and the server in which further analyzation can be continued ``test-2.gss.redhat.com``.
+and the server in which further analyzation can be continued ``x86_64.cas-server.com``.
Normally from a support perspective this email should contain enough information
for a kernel engineer to begin debugging the problem. Assuming more is needed
@@ -272,18 +276,23 @@ manual approach some alterations to the script need to occur.
crash wrapper in its original form::
#!/bin/sh
- /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux -s < /cores/processed/12345/02.11.09.08.44.19/crash.in
+ /usr/bin/crash \
+ /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
+ /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ -s < /cores/processed/12345/02.11.09.08.44.19/crash.in
In order to remove automation the redirect from crash.in needs to be removed::
#!/bin/sh
- /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux
+ /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
+ /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux
**Alternative to using the crash wrapper**
It is possible to specify the vmlinux and corefile with crash on the command line::
- $ crash /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux /cores/processed/12345/02.11.09.08.44.19/vmcore.12345
+ $ crash /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ /cores/processed/12345/02.11.09.08.44.19/vmcore.12345
``crash.in``: a list of commands to be read into crash during the automated
analysis::
@@ -300,7 +309,8 @@ is sent in an email if defined.
``usr``: directory structure from the extraction of the vmlinux file
from the associated kernel-debuginfo rpm for use within crash::
- /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux
+ /cores/processed/12345/02.11.09.08.44.19/
+ usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux
``vmcore.12345``: corefile from which was either defined or extracted from
a compressed archive during CAS initialization.
diff --git a/doc/_static/basic.css b/doc/_static/basic.css
new file mode 100644
index 0000000..ed737d3
--- /dev/null
+++ b/doc/_static/basic.css
@@ -0,0 +1,414 @@
+/**
+ * Sphinx stylesheet -- basic theme
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.documentwrapper {
+ float: left;
+ width: 100%;
+}
+
+div.bodywrapper {
+ margin: 0 0 0 230px;
+}
+
+div.clearer {
+ clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+img {
+ border: 0;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+a.headerlink {
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.field-list ul {
+ padding-left: 1em;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px 7px 0 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 0;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+dt:target, .highlight {
+ background-color: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.refcount {
+ color: #060;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #ffa
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ overflow: auto;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+tt.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+tt.descclassname {
+ background-color: transparent;
+}
+
+tt.xref, a tt {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+ background-color: transparent;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0;
+ width: 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ #top-link {
+ display: none;
+ }
+}
diff --git a/doc/_static/default.css b/doc/_static/default.css
index 005caa1..c13ed68 100644
--- a/doc/_static/default.css
+++ b/doc/_static/default.css
@@ -1,7 +1,12 @@
/**
- * Sphinx Doc Design
+ * Sphinx stylesheet -- default theme
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- */
+
body {
font-family: sans-serif;
font-size: 100%;
@@ -11,43 +16,18 @@ body {
padding: 0;
}
-/* :::: LAYOUT :::: */
-
div.document {
background-color: #1c4e63;
}
-div.documentwrapper {
- float: left;
- width: 100%;
-}
-
-div.bodywrapper {
- margin: 0 0 0 230px;
-}
-
div.body {
- background-color: white;
+ background-color: #ffffff;
+ color: #000000;
padding: 0 20px 30px 20px;
}
-div.sphinxsidebarwrapper {
- padding: 10px 5px 0 10px;
-}
-
-div.sphinxsidebar {
- float: left;
- width: 230px;
- margin-left: -100%;
- font-size: 90%;
-}
-
-div.clearer {
- clear: both;
-}
-
div.footer {
- color: #fff;
+ color: #ffffff;
width: 100%;
padding: 9px 0 9px 0;
text-align: center;
@@ -55,45 +35,26 @@ div.footer {
}
div.footer a {
- color: #fff;
+ color: #ffffff;
text-decoration: underline;
}
div.related {
background-color: #133f52;
- color: #fff;
- width: 100%;
line-height: 30px;
- font-size: 90%;
-}
-
-div.related h3 {
- display: none;
-}
-
-div.related ul {
- margin: 0;
- padding: 0 0 0 10px;
- list-style: none;
-}
-
-div.related li {
- display: inline;
+ color: #ffffff;
}
-div.related li.right {
- float: right;
- margin-right: 5px;
+div.related a {
+ color: #ffffff;
}
-div.related a {
- color: white;
+div.sphinxsidebar {
}
-/* ::: TOC :::: */
div.sphinxsidebar h3 {
font-family: 'Trebuchet MS', sans-serif;
- color: white;
+ color: #ffffff;
font-size: 1.4em;
font-weight: normal;
margin: 0;
@@ -101,12 +62,12 @@ div.sphinxsidebar h3 {
}
div.sphinxsidebar h3 a {
- color: white;
+ color: #ffffff;
}
div.sphinxsidebar h4 {
font-family: 'Trebuchet MS', sans-serif;
- color: white;
+ color: #ffffff;
font-size: 1.3em;
font-weight: normal;
margin: 5px 0 0 0;
@@ -114,7 +75,7 @@ div.sphinxsidebar h4 {
}
div.sphinxsidebar p {
- color: white;
+ color: #ffffff;
}
div.sphinxsidebar p.topless {
@@ -124,171 +85,20 @@ div.sphinxsidebar p.topless {
div.sphinxsidebar ul {
margin: 10px;
padding: 0;
- list-style: none;
- color: white;
-}
-
-div.sphinxsidebar ul ul,
-div.sphinxsidebar ul.want-points {
- margin-left: 20px;
- list-style: square;
-}
-
-div.sphinxsidebar ul ul {
- margin-top: 0;
- margin-bottom: 0;
+ color: #ffffff;
}
div.sphinxsidebar a {
color: #98dbcc;
}
-div.sphinxsidebar form {
- margin-top: 10px;
-}
-
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
-/* :::: MODULE CLOUD :::: */
-div.modulecloud {
- margin: -5px 10px 5px 10px;
- padding: 10px;
- line-height: 160%;
- border: 1px solid #cbe7e5;
- background-color: #f2fbfd;
-}
-
-div.modulecloud a {
- padding: 0 5px 0 5px;
-}
-
-/* :::: SEARCH :::: */
-ul.search {
- margin: 10px 0 0 20px;
- padding: 0;
-}
-
-ul.search li {
- padding: 5px 0 5px 20px;
- background-image: url(file.png);
- background-repeat: no-repeat;
- background-position: 0 7px;
-}
-
-ul.search li a {
- font-weight: bold;
-}
-
-ul.search li div.context {
- color: #888;
- margin: 2px 0 0 30px;
- text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
- font-weight: bold;
-}
-
-/* :::: COMMON FORM STYLES :::: */
-
-div.actions {
- padding: 5px 10px 5px 10px;
- border-top: 1px solid #cbe7e5;
- border-bottom: 1px solid #cbe7e5;
- background-color: #e0f6f4;
-}
-
-form dl {
- color: #333;
-}
-
-form dt {
- clear: both;
- float: left;
- min-width: 110px;
- margin-right: 10px;
- padding-top: 2px;
-}
-
-input#homepage {
- display: none;
-}
-
-div.error {
- margin: 5px 20px 0 0;
- padding: 5px;
- border: 1px solid #d00;
- font-weight: bold;
-}
-
-/* :::: INDEX PAGE :::: */
-
-table.contentstable {
- width: 90%;
-}
-
-table.contentstable p.biglink {
- line-height: 150%;
-}
-
-a.biglink {
- font-size: 1.3em;
-}
-
-span.linkdescr {
- font-style: italic;
- padding-top: 5px;
- font-size: 90%;
-}
-
-/* :::: INDEX STYLES :::: */
-
-table.indextable td {
- text-align: left;
- vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
- height: 10px;
-}
-
-table.indextable tr.cap {
- margin-top: 10px;
- background-color: #f2f2f2;
-}
-
-img.toggler {
- margin-right: 3px;
- margin-top: 3px;
- cursor: pointer;
-}
-
-form.pfform {
- margin: 10px 0 20px 0;
-}
-
-/* :::: GLOBAL STYLES :::: */
-
-.docwarning {
- background-color: #ffe4e4;
- padding: 10px;
- margin: 0 -20px 0 -20px;
- border-bottom: 1px solid #f66;
-}
-
-p.subhead {
- font-weight: bold;
- margin-top: 20px;
-}
+/* -- body styles ----------------------------------------------------------- */
a {
color: #355f7c;
@@ -299,6 +109,11 @@ a:hover {
text-decoration: underline;
}
+div.body p, div.body dd, div.body li {
+ text-align: justify;
+ line-height: 130%;
+}
+
div.body h1,
div.body h2,
div.body h3,
@@ -326,17 +141,6 @@ a.headerlink {
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
- visibility: hidden;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
- visibility: visible;
}
a.headerlink:hover {
@@ -349,82 +153,13 @@ div.body p, div.body dd, div.body li {
line-height: 130%;
}
-div.body p.caption {
- text-align: inherit;
-}
-
-div.body td {
- text-align: left;
-}
-
-ul.fakelist {
- list-style: none;
- margin: 10px 0 10px 20px;
- padding: 0;
-}
-
-.field-list ul {
- padding-left: 1em;
-}
-
-.first {
- margin-top: 0 !important;
-}
-
-/* "Footnotes" heading */
-p.rubric {
- margin-top: 30px;
- font-weight: bold;
-}
-
-/* Sidebars */
-
-div.sidebar {
- margin: 0 0 0.5em 1em;
- border: 1px solid #ddb;
- padding: 7px 7px 0 7px;
- background-color: #ffe;
- width: 40%;
- float: right;
-}
-
-p.sidebar-title {
- font-weight: bold;
+div.admonition p.admonition-title + p {
+ display: inline;
}
-/* "Topics" */
-
-div.topic {
+div.note {
background-color: #eee;
border: 1px solid #ccc;
- padding: 7px 7px 0 7px;
- margin: 10px 0 10px 0;
-}
-
-p.topic-title {
- font-size: 1.1em;
- font-weight: bold;
- margin-top: 10px;
-}
-
-/* Admonitions */
-
-div.admonition {
- margin-top: 10px;
- margin-bottom: 10px;
- padding: 7px;
-}
-
-div.admonition dt {
- font-weight: bold;
-}
-
-div.admonition dl {
- margin-bottom: 0;
-}
-
-div.admonition p.admonition-title + p {
- display: inline;
}
div.seealso {
@@ -432,19 +167,16 @@ div.seealso {
border: 1px solid #ff6;
}
+div.topic {
+ background-color: #eee;
+}
+
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
-div.note {
- background-color: #eee;
- border: 1px solid #ccc;
-}
-
p.admonition-title {
- margin: 0px 10px 5px 0px;
- font-weight: bold;
display: inline;
}
@@ -452,206 +184,18 @@ p.admonition-title:after {
content: ":";
}
-div.body p.centered {
- text-align: center;
- margin-top: 25px;
-}
-
-table.docutils {
- border: 0;
-}
-
-table.docutils td, table.docutils th {
- padding: 1px 8px 1px 0;
- border-top: 0;
- border-left: 0;
- border-right: 0;
- border-bottom: 1px solid #aaa;
-}
-
-table.field-list td, table.field-list th {
- border: 0 !important;
-}
-
-table.footnote td, table.footnote th {
- border: 0 !important;
-}
-
-.field-list ul {
- margin: 0;
- padding-left: 1em;
-}
-
-.field-list p {
- margin: 0;
-}
-
-dl {
- margin-bottom: 15px;
- clear: both;
-}
-
-dd p {
- margin-top: 0px;
-}
-
-dd ul, dd table {
- margin-bottom: 10px;
-}
-
-dd {
- margin-top: 3px;
- margin-bottom: 10px;
- margin-left: 30px;
-}
-
-.refcount {
- color: #060;
-}
-
-dt:target,
-.highlight {
- background-color: #fbe54e;
-}
-
-dl.glossary dt {
- font-weight: bold;
- font-size: 1.1em;
-}
-
-th {
- text-align: left;
- padding-right: 5px;
-}
-
pre {
padding: 5px;
- background-color: #efc;
- color: #333;
+ background-color: #eeffcc;
+ color: #333333;
+ line-height: 120%;
border: 1px solid #ac9;
border-left: none;
border-right: none;
- overflow: auto;
-}
-
-td.linenos pre {
- padding: 5px 0px;
- border: 0;
- background-color: transparent;
- color: #aaa;
-}
-
-table.highlighttable {
- margin-left: 0.5em;
-}
-
-table.highlighttable td {
- padding: 0 0.5em 0 0.5em;
}
tt {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
-}
-
-tt.descname {
- background-color: transparent;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-tt.descclassname {
- background-color: transparent;
-}
-
-tt.xref, a tt {
- background-color: transparent;
- font-weight: bold;
-}
-
-.footnote:target { background-color: #ffa }
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
- background-color: transparent;
-}
-
-.optional {
- font-size: 1.3em;
-}
-
-.versionmodified {
- font-style: italic;
-}
-
-form.comment {
- margin: 0;
- padding: 10px 30px 10px 30px;
- background-color: #eee;
-}
-
-form.comment h3 {
- background-color: #326591;
- color: white;
- margin: -10px -30px 10px -30px;
- padding: 5px;
- font-size: 1.4em;
-}
-
-form.comment input,
-form.comment textarea {
- border: 1px solid #ccc;
- padding: 2px;
- font-family: sans-serif;
- font-size: 100%;
-}
-
-form.comment input[type="text"] {
- width: 240px;
-}
-
-form.comment textarea {
- width: 100%;
- height: 200px;
- margin-bottom: 10px;
-}
-
-.system-message {
- background-color: #fda;
- padding: 5px;
- border: 3px solid red;
-}
-
-img.math {
- vertical-align: middle;
-}
-
-div.math p {
- text-align: center;
-}
-
-span.eqno {
- float: right;
-}
-
-img.logo {
- border: 0;
-}
-
-/* :::: PRINT :::: */
-@media print {
- div.document,
- div.documentwrapper,
- div.bodywrapper {
- margin: 0;
- width : 100%;
- }
-
- div.sphinxsidebar,
- div.related,
- div.footer,
- div#comments div.new-comment-box,
- #top-link {
- display: none;
- }
-}
+}
\ No newline at end of file
diff --git a/doc/_static/doctools.js b/doc/_static/doctools.js
index be4bdc8..9447678 100644
--- a/doc/_static/doctools.js
+++ b/doc/_static/doctools.js
@@ -133,13 +133,13 @@ var Documentation = {
* add context elements like header anchor links
*/
addContextElements : function() {
- $('div[@id] > :header:first').each(function() {
+ $('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
- $('dt[@id]').each(function() {
+ $('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
diff --git a/doc/_static/searchtools.js b/doc/_static/searchtools.js
index f9d9b6c..a243b15 100644
--- a/doc/_static/searchtools.js
+++ b/doc/_static/searchtools.js
@@ -221,7 +221,7 @@ var Search = {
var params = $.getQueryParameters();
if (params.q) {
var query = params.q[0];
- $('input[@name="q"]')[0].value = query;
+ $('input[name="q"]')[0].value = query;
this.performSearch(query);
}
},
@@ -283,7 +283,7 @@ var Search = {
if (this.hasIndex())
this.query(query);
else
- this.setQuery(query);
+ this.deferQuery(query);
},
query : function(query) {
diff --git a/doc/genindex.html b/doc/genindex.html
index d7df1e0..624177a 100644
--- a/doc/genindex.html
+++ b/doc/genindex.html
@@ -1,15 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Index — CAS v0.13-118 documentation</title>
+ <title>Index — cas v0.14 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
- VERSION: '0.13-118',
+ VERSION: '0.14',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -17,9 +19,7 @@
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="index" title="Index" href="" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="top" title="CAS v0.13-118 documentation" href="index.html" />
+ <link rel="top" title="cas v0.14 documentation" href="index.html" />
</head>
<body>
<div class="related">
@@ -28,9 +28,10 @@
<li class="right" style="margin-right: 10px">
<a href="" title="General Index"
accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.13-118 documentation</a> »</li>
+ <li><a href="index.html">cas v0.14 documentation</a> »</li>
</ul>
</div>
+
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
@@ -54,12 +55,19 @@
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
+ <div id="searchbox" style="display: none">
+ <h3>Quick search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" size="18" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
@@ -69,13 +77,13 @@
<ul>
<li class="right" style="margin-right: 10px">
<a href="" title="General Index"
- accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.13-118 documentation</a> »</li>
+ >index</a></li>
+ <li><a href="index.html">cas v0.14 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.1.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
</div>
</body>
</html>
\ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
index 72522e1..8d12fc9 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -1,15 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Core Analysis System — CAS v0.13-118 documentation</title>
+ <title>Core Analysis System — cas v0.14 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
- VERSION: '0.13-118',
+ VERSION: '0.14',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -17,9 +19,7 @@
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="top" title="CAS v0.13-118 documentation" href="" />
+ <link rel="top" title="cas v0.14 documentation" href="" />
</head>
<body>
<div class="related">
@@ -28,20 +28,20 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
- <li><a href="">CAS v0.13-118 documentation</a> »</li>
+ <li><a href="">cas v0.14 documentation</a> »</li>
</ul>
</div>
+
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
-
- <img alt="_images/cas_logo.png" src="_images/cas_logo.png" />
-<div class="section" id="core-analysis-system">
+ <div class="section" id="core-analysis-system">
<h1>Core Analysis System<a class="headerlink" href="#core-analysis-system" title="Permalink to this headline">¶</a></h1>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<img alt="_images/cas_logo.png" src="_images/cas_logo.png" />
<div class="section" id="description">
<h3>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h3>
<p>CAS provides a user the ability to configure an environment for core analysis
@@ -50,7 +50,7 @@ types to core dumps are automatically detected and processed.</p>
</div>
<div class="section" id="prerequisites">
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h3>
-<p>CAS needs at least <strong>Python 2.4</strong> to run. For systems that are not running
+<p>CAS needs at least <strong>Python 2.3</strong> to run. For systems that are not running
Fedora 9 or later (this would include RHEL 4/5) the EPEL repo needs to be
installed. Visit <a class="reference external" href="https://fedoraproject.org/wiki/EPEL">EPEL</a> to enable
this repository.</p>
@@ -59,13 +59,17 @@ for automatic processing on other architecture specific systems. This
can easily be installed via <cite>yum</cite>:</p>
<div class="highlight-python"><pre>$ yum install func</pre>
</div>
-<p>Storage size can be determined based on how many kernel-debuginfo to be stored
-and how many core dumps and their filesize will be processed. Typically, it is
-recommended for at least 1TB for cores and another 500GB for debuginfo’s.</p>
+<p>The amount of storage needed can be determined base on the following
+information:</p>
+<ul class="simple">
+<li>The number of kernel-debuginfo packages needed</li>
+<li>How many core dumps will be processed.</li>
+</ul>
+<p>Typically it is recommended to have at least 1TB for cores and another 500GB for
+the debuginfo packages.</p>
<p>Since analyzing cores requires the same architecture specific systems the core
was generated on there will need to be systems available of those same types
in order for analyzation to work properly.</p>
-<p>Finally, root access to the CAS server.</p>
</div>
<div class="section" id="configuration">
<h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h3>
@@ -74,22 +78,21 @@ The overall contents of this file is shown below, further down we will break up
each section and describe its meaning:</p>
<div class="highlight-python"><pre>[settings]
kernels=/mnt/kernels
-rpms=/var/db/cas/rpms.db
-rpmFilter=.*kernel-debuginfo-[0-9].*\.rpm
+rpmFilter=.*kerne.+-debuginfo-[0-9].*\.rpm
debugs=/cores/debugs
debugLevel=DEBUG
workDirectory=/cores/processed
-servers=/var/db/cas/servers.db
-jobs=/var/db/cas/jobs.db
mailServer=mail.example.com
+database=/var/db/cas/cas.db
+[maintenance]
+purgeLimit=90
+autoPurge=False
[advanced]
# crash_32=/usr/local/i386/crash</pre>
</div>
<p><tt class="docutils literal"><span class="pre">kernels</span></tt>: (<strong>Required</strong>) Describes the location of where kernel-debuginfo packages are to be
stored. This can range anywhere from an nfs mount, samba share, local disk or
any other type of media the cas server can access.</p>
-<p><tt class="docutils literal"><span class="pre">rpms</span></tt>: (<strong>Required</strong>) Database which houses the processing of kernel-debuginfo and stores the
-necessary information for CAS to properly match core dumps.</p>
<p><tt class="docutils literal"><span class="pre">rpmFilters</span></tt>: (<strong>Required</strong>) This is a emacs based regular expression which is essentially
passed to a find command to locate the various kernel-debuginfo packages defined
in <tt class="docutils literal"><span class="pre">kernels</span></tt> directive.</p>
@@ -101,13 +104,14 @@ Currently the only accepted values are <tt class="docutils literal"><span class=
<p><tt class="docutils literal"><span class="pre">workDirectory</span></tt>: (<strong>Required</strong>) Defines where all processed cores will be placed. This mount
point will need to have the most storage assigned to it. Depending on how many
cores are processed in a given timeframe this area will fill up quickly.</p>
-<p><tt class="docutils literal"><span class="pre">servers</span></tt>: If func is installed and configured all associated servers will
-be stored here.</p>
-<p><tt class="docutils literal"><span class="pre">jobs</span></tt>: Contains information on current jobs being processed and eventually
-what jobs are in the queue.</p>
<p><tt class="docutils literal"><span class="pre">mailServer</span></tt>: If wanting output of CAS processing email to a certain address
this directive needs to be set. <tt class="docutils literal"><span class="pre">Note</span></tt> that the mail server should not
require smtp authentication.</p>
+<p><tt class="docutils literal"><span class="pre">database</span></tt>: (<strong>Required</strong>) Define where the sqlite database will reside.</p>
+<p><tt class="docutils literal"><span class="pre">purgeLimit</span></tt>: Define amount of day(s) back wish to keep physical data on
+system.</p>
+<p><tt class="docutils literal"><span class="pre">autoPurge</span></tt>: True/False setting if wanting cas-admin to auto purge stale data on
+each run.</p>
<p><tt class="docutils literal"><span class="pre">crash_32</span></tt>: Primarily used on x86_64 systems to process x86 cores. If x86
version of crash is installed this directive can be set to the crash binary
and CAS will automatically process x86 cores on a x86_64 machine. <tt class="docutils literal"><span class="pre">Note</span></tt> this
@@ -137,14 +141,15 @@ to a different location.</p>
following:</p>
<div class="highlight-python"><pre>[settings]
kernels=/mnt/kernels
-rpms=/var/db/cas/rpms.db
-rpmFilter=.*kernel-debuginfo-[0-9].*\.rpm
+rpmFilter=.*kerne.+-debuginfo-[0-9].*\.rpm
debugs=/tmp
debugLevel=DEBUG
workDirectory=/cores
-servers=/var/db/cas/servers.db
-jobs=/var/db/cas/jobs.db
mailServer=mail.cas-server.com
+database=/var/db/cas/cas.db
+[maintenance]
+purgeLimit=90
+autoPurge=False
[advanced]
crash_32=/usr/local/i386/crash</pre>
</div>
@@ -208,7 +213,7 @@ and look something similar to:</p>
Date: Wed, 11 Feb 2009 08:44:37 -0500
Location: /cores/processed/12345/02.11.09.08.44.19
-Server: test-2.gss.redhat.com
+Server: x86_64.cas-server.com
Output data:
PID: 0 TASK: ffffffff803e9b80 CPU: 0 COMMAND: "swapper"
#0 [ffffffff8047a0a0] smp_call_function_interrupt at ffffffff8011d191
@@ -251,7 +256,7 @@ PID: 6122 TASK: 101f3658030 CPU: 2 COMMAND: "gfs_quotad"
... snip ...</pre>
</div>
<p>From this email a <tt class="docutils literal"><span class="pre">location</span></tt> is provided <tt class="docutils literal"><span class="pre">/cores/processed/12345/02.11.09.08.44.19</span></tt>
-and the server in which further analyzation can be continued <tt class="docutils literal"><span class="pre">test-2.gss.redhat.com</span></tt>.</p>
+and the server in which further analyzation can be continued <tt class="docutils literal"><span class="pre">x86_64.cas-server.com</span></tt>.</p>
<p>Normally from a support perspective this email should contain enough information
for a kernel engineer to begin debugging the problem. Assuming more is needed
the information provided previously will prove beneficial for anyone wishing
@@ -270,15 +275,20 @@ data from the coredump. <tt class="docutils literal"><span class="pre">Note</spa
manual approach some alterations to the script need to occur.</p>
<p>crash wrapper in its original form:</p>
<div class="highlight-python"><pre>#!/bin/sh
-/usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux -s < /cores/processed/12345/02.11.09.08.44.19/crash.in</pre>
+ /usr/bin/crash \
+ /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
+ /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ -s < /cores/processed/12345/02.11.09.08.44.19/crash.in</pre>
</div>
<p>In order to remove automation the redirect from crash.in needs to be removed:</p>
<div class="highlight-python"><pre>#!/bin/sh
-/usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux</pre>
+ /usr/bin/crash /cores/processed/12345/02.11.09.08.44.19/vmcore.12345 \
+ /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux</pre>
</div>
<p><strong>Alternative to using the crash wrapper</strong></p>
<p>It is possible to specify the vmlinux and corefile with crash on the command line:</p>
-<div class="highlight-python"><pre>$ crash /cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux /cores/processed/12345/02.11.09.08.44.19/vmcore.12345</pre>
+<div class="highlight-python"><pre>$ crash /cores/processed/12345/02.11.09.08.44.19/usr/*/*/*/*/2.6.9*largesmp/vmlinux \
+ /cores/processed/12345/02.11.09.08.44.19/vmcore.12345</pre>
</div>
<p><tt class="docutils literal"><span class="pre">crash.in</span></tt>: a list of commands to be read into crash during the automated
analysis:</p>
@@ -292,7 +302,8 @@ exit</pre>
is sent in an email if defined.</p>
<p><tt class="docutils literal"><span class="pre">usr</span></tt>: directory structure from the extraction of the vmlinux file
from the associated kernel-debuginfo rpm for use within crash:</p>
-<div class="highlight-python"><pre>/cores/processed/12345/02.11.09.08.44.19/usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux</pre>
+<div class="highlight-python"><pre>/cores/processed/12345/02.11.09.08.44.19/
+ usr/lib/debug/lib/modules/2.6.9-78.18.ELlargesmp/vmlinux</pre>
</div>
<p><tt class="docutils literal"><span class="pre">vmcore.12345</span></tt>: corefile from which was either defined or extracted from
a compressed archive during CAS initialization.</p>
@@ -363,14 +374,22 @@ no errors.</p>
<h3>This Page</h3>
<ul class="this-page-menu">
- <li><a href="_sources/index.txt">Show Source</a></li>
+ <li><a href="_sources/index.txt"
+ rel="nofollow">Show Source</a></li>
</ul>
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
+ <div id="searchbox" style="display: none">
+ <h3>Quick search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" size="18" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
@@ -380,13 +399,13 @@ no errors.</p>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li><a href="">CAS v0.13-118 documentation</a> »</li>
+ >index</a></li>
+ <li><a href="">cas v0.14 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.1.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
</div>
</body>
</html>
\ No newline at end of file
diff --git a/doc/index.rst b/doc/index.rst
index 3c9cb59..b380b4d 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -16,7 +16,7 @@ types to core dumps are automatically detected and processed.
Prerequisites
^^^^^^^^^^^^^
-CAS needs at least **Python 2.4** to run. For systems that are not running
+CAS needs at least **Python 2.3** to run. For systems that are not running
Fedora 9 or later (this would include RHEL 4/5) the EPEL repo needs to be
installed. Visit `EPEL <https://fedoraproject.org/wiki/EPEL>`_ to enable
this repository.
@@ -57,7 +57,7 @@ each section and describe its meaning::
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
- autoPurge=False
+ autoPurge=Yes
[advanced]
# crash_32=/usr/local/i386/crash
@@ -89,7 +89,7 @@ require smtp authentication.
``purgeLimit``: Define amount of day(s) back wish to keep physical data on
system.
-``autoPurge``: True/False setting if wanting cas-admin to auto purge stale data on
+``autoPurge``: Yes/No setting if wanting cas-admin to auto purge stale data on
each run.
``crash_32``: Primarily used on x86_64 systems to process x86 cores. If x86
@@ -134,7 +134,7 @@ following::
database=/var/db/cas/cas.db
[maintenance]
purgeLimit=90
- autoPurge=False
+ autoPurge=Yes
[advanced]
crash_32=/usr/local/i386/crash
diff --git a/doc/objects.inv b/doc/objects.inv
index e0a1817..2f84a03 100644
--- a/doc/objects.inv
+++ b/doc/objects.inv
@@ -1,3 +1,3 @@
# Sphinx inventory version 1
-# Project: CAS
-# Version: 0.13
+# Project: cas
+# Version: 0.14
diff --git a/doc/search.html b/doc/search.html
index e2cb21b..7d3804b 100644
--- a/doc/search.html
+++ b/doc/search.html
@@ -1,15 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Search — CAS v0.13-118 documentation</title>
+ <title>Search — cas v0.14 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
- VERSION: '0.13-118',
+ VERSION: '0.14',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -18,9 +20,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="" />
- <link rel="top" title="CAS v0.13-118 documentation" href="index.html" />
+ <link rel="top" title="cas v0.14 documentation" href="index.html" />
</head>
<body>
<div class="related">
@@ -29,15 +29,23 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.13-118 documentation</a> »</li>
+ <li><a href="index.html">cas v0.14 documentation</a> »</li>
</ul>
</div>
+
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1 id="search-documentation">Search</h1>
+ <div id="fallback" class="admonition warning">
+ <script type="text/javascript">$('#fallback').hide();</script>
+ <p>
+ Please activate JavaScript to enable the search
+ functionality.
+ </p>
+ </div>
<p>
From here you can search these documents. Enter your search
words into the box below and click "search". Note that the search
@@ -68,14 +76,14 @@
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.13-118 documentation</a> »</li>
+ >index</a></li>
+ <li><a href="index.html">cas v0.14 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.1.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
</div>
<script type="text/javascript" src="searchindex.js"></script>
diff --git a/doc/searchindex.js b/doc/searchindex.js
index 5fd6ed0..7241f0c 100644
--- a/doc/searchindex.js
+++ b/doc/searchindex.js
@@ -1 +1 @@
-Search.setIndex({desctypes:{},terms:{all:0,mnt:0,snip:0,abil:0,follow:0,disk:0,depend:0,do_dlm_lock:0,those:0,aris:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,faq:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,setup:0,pleas:0,x86_64:0,intial:0,direct:0,pass:0,download:0,further:0,what:0,sub:0,section:0,abl:0,access:0,version:0,autogener:0,gener:0,here:0,address:0,path:0,sinc:0,valu:0,ffffffff80110bf5:0,rdx:0,queue:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,via:0,repositori:0,modul:0,prefer:0,crash_32:0,filenam:0,instal:0,feb:0,describ:0,would:0,prove:0,doubl:0,visit:0,two:0,next:0,few:0,rhel:0,recommend:0,type:0,tell:0,more:0,sort:0,wrapper:0,smtp:0,ffffffff803e9b80:0,ffffffff8010e81c:0,must:0,retriev:0,hous:0,prepar:0,work:0,uniqu:0,can:0,root:0,tar:0,process:0,share:0,accept:0,want:0,occur:0,multipl:0,anoth:0,how:0,error_exit:0,anyon:0,verifi:0,perspect:0,ffffffff80528000:0,resourc:0,"00000102000a4780":0,clone:0,reflect:0,mai:0,data:0,fedora:0,essenti:0,issu:0,inform:0,environ:0,media:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,ellargesmp:0,bin:0,mail:0,main:0,alter:0,crash:0,than:0,python:0,timestamp:0,overal:0,initi:0,number:0,"break":0,mention:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,easili:0,each:0,debug:0,mean:0,continu:0,happen:0,extract:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,ffffffff8011d191:0,content:0,fffffffffffffffa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,keep:0,vmlinux:0,thing:0,yum:0,isn:0,assign:0,first:0,origin:0,rang:0,redhat:0,onc:0,debuglevel:0,swapper:0,instruct:0,done:0,least:0,rflag:0,size:0,differ:0,script:0,associ:0,system:0,messag:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,boil:0,editor:0,option:0,debuginfo:0,tool:0,specifi:0,"var":0,exactli:0,rsp:0,corefil:0,provid:0,remov:0,emac:0,structur:0,store:0,analysi:0,anywher:0,packag:0,have:0,call_function_interrupt:0,"101f3658030":0,rax:0,rsi:0,date:0,bz2:0,lib:0,note:0,also:0,build:0,which:0,begin:0,normal:0,previou:0,compress:0,most:0,regular:0,deploi:0,everyth:0,"101f21efb80":0,gather:0,place:0,determin:0,irq:0,latest:0,show:0,text:0,find:0,redirect:0,current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,requir:0,enabl:0,organ:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,see:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,databas:0,someth:0,enough:0,listinfo:[],approach:0,email:0,altern:0,assumpt:0,cpu_idl:0,default_idl:0,job:0,come:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,mailman:[],coredump:0,"101f21efb50":0,mark:0,much:0,popul:0,quickli:0,wish:0,ani:0,try_crashdump:0,"0000000000000e86":0,func:0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,rbp:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,need:0,archiv:0,uncom:0,conf:0,fedorahost:0,sever:0,thei:0,suggest:0,same:0,binari:0,eventu:0,http:[],x86:0,temporari:0,user:0,"500gb":0,engin:0,stack:0,gss:0,task:0,"10001073e98":0,do_invalid_op:0,exampl:0,command:0,thi:0,filesystem:0,gzip:0,fail:0,usual:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,wed:0,except:0,other:0,match:0,opt:0,read:0,mod:0,"1000107bfa0":0,like:0,specif:0,manual:0,resolv:0,server:0,collect:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,some:0,gfs_quotad:0,proper:0,tmp:0,mailserv:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,core:0,who:0,run:0,reach:0,usag:0,prerequisit:0,from:0,unfortun:0,primarili:0,within:0,automat:0,down:0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,support:0,question:0,avail:0,includ:0,suit:0,hassl:0,usr:0,files:0,properli:0,form:0,pwd:0,line:0,analyst:0,info:0,made:0,possibl:0,checkout:0,below:0,ffffffff80111c90:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,valid:0,test:0,ffffffff8010e7a9:0,architectur:0,benefici:0,ffffffff80529fb8:0,directori:0,descript:0,"1tb":0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
+Search.setIndex({desctypes:{},terms:{all:0,mnt:0,snip:0,abil:0,follow:0,disk:0,depend:0,wish:0,do_dlm_lock:0,those:0,aris:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,fals:0,faq:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,prepar:0,pleas:0,x86_64:0,core:0,direct:0,pass:0,download:0,further:0,sub:0,section:0,abl:0,access:0,version:0,autogener:0,gener:0,here:0,address:0,path:0,sinc:0,valu:0,ffffffff80110bf5:0,rdx:0,amount:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,via:0,repositori:0,modul:0,prefer:0,crash_32:0,filenam:0,instal:0,feb:0,describ:0,would:0,prove:0,doubl:0,visit:0,two:0,next:0,few:0,usr:0,recommend:0,type:0,tell:0,more:0,sort:0,share:0,ffffffff803e9b80:0,ffffffff8010e81c:0,must:0,retriev:0,hous:0,setup:0,work:0,uniqu:0,can:0,root:0,sqlite:0,tar:0,process:0,smtp:0,accept:0,want:0,occur:0,multipl:0,anoth:0,how:0,error_exit:0,purg:0,opt:0,verifi:0,perspect:0,ffffffff80528000:0,resourc:0,"00000102000a4780":0,clone:0,reflect:0,mai:0,data:0,physic:0,fedora:0,essenti:0,issu:0,inform:0,environ:0,media:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,requir:0,mail:0,main:0,alter:0,messag:0,crash:0,than:0,python:0,auto:0,overal:0,dai:0,initi:0,"break":0,mention:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,kern:0,easili:0,each:0,debug:0,mean:0,continu:0,happen:0,extract:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,ffffffff8011d191:0,content:0,fffffffffffffffa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,keep:0,vmlinux:0,thing:0,place:0,isn:0,assign:0,first:0,origin:0,rang:0,onc:0,number:0,swapper:0,instruct:0,done:0,wrapper:0,rflag:0,differ:0,script:0,associ:0,system:0,least:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,boil:0,editor:0,option:0,debuginfo:0,tool:0,specifi:0,hassl:0,exactli:0,rsp:0,corefil:0,provid:0,remov:0,emac:0,structur:0,store:0,stale:0,ani:0,fail:0,have:0,call_function_interrupt:0,"101f3658030":0,rax:0,rsi:0,packag:0,date:0,bz2:0,lib:0,note:0,also:0,build:0,which:0,begin:0,normal:0,previou:0,compress:0,most:0,regular:0,deploi:0,"101f21efb80":0,gather:0,yum:0,determin:0,irq:0,usual:0,show:0,text:0,find:0,redirect:0,current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,mainten:0,ellargesmp:0,enabl:0,organ:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,see:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,purgelimit:0,databas:0,someth:0,enough:0,approach:0,email:0,altern:0,assumpt:0,cpu_idl:0,default_idl:0,job:0,come:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,coredump:0,"101f21efb50":0,mark:0,much:0,popul:0,quickli:0,largesmp:0,anywher:0,try_crashdump:0,"0000000000000e86":0,func:0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,rbp:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,need:0,archiv:0,uncom:0,conf:0,fedorahost:0,sever:0,thei:0,suggest:0,same:0,binari:0,timestamp:0,x86:0,temporari:0,user:0,"500gb":0,engin:0,stack:0,task:0,"10001073e98":0,do_invalid_op:0,exampl:0,command:0,thi:0,filesystem:0,gzip:0,everyth:0,latest:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,wed:0,except:0,valid:0,match:0,bin:0,read:0,debuglevel:0,mod:0,"1000107bfa0":0,resid:0,like:0,specif:0,anyon:0,manual:0,resolv:0,server:0,collect:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,some:0,back:0,gfs_quotad:0,proper:0,tmp:0,mailserv:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,intial:0,who:0,run:0,reach:0,usag:0,prerequisit:0,from:0,unfortun:0,primarili:0,within:0,automat:0,down:0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,support:0,question:0,avail:0,includ:0,suit:0,"var":0,rhel:0,analysi:0,properli:0,form:0,pwd:0,line:0,"true":0,analyst:0,info:0,made:0,possibl:0,checkout:0,below:0,ffffffff80111c90:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,other:0,ffffffff8010e7a9:0,architectur:0,benefici:0,autopurg:0,ffffffff80529fb8:0,directori:0,descript:0,"1tb":0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
14 years, 12 months
cas.1 cas-admin cas-admin.1
by Adam Stokes
cas-admin | 6 +++---
cas-admin.1 | 3 ++-
cas.1 | 7 +++++--
3 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit d023fc833d32b211229800d366f24745166bafc6
Author: Adam Stokes <adam.stokes(a)gmail.com>
Date: Tue May 5 19:00:54 2009 -0400
- man page updates
- re-work regex in date search patter for purge
diff --git a/cas-admin b/cas-admin
index 2e3d9b3..6824566 100755
--- a/cas-admin
+++ b/cas-admin
@@ -157,10 +157,10 @@ class PurgeHandler(object):
dirpath = os.path.join(root,d)
# pull out date from directory structure and trim it to
# (year, month, day)
- searchDate = self.util.regexSearch('(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)', dirpath)
+ searchDate = self.util.regexSearch('(\d{4})\.(\d+)\.(\d+)', dirpath)
if searchDate:
self.casLog.debug('found %s' % (searchDate,))
- (year, month, day) = searchDate.split('.')[:3]
+ (year, month, day) = searchDate.split('.')
# create our datetime object so we can do some arithmetic
dirDate = datetime.date(int(year), int(month), int(day))
self.casLog.debug(dirDate)
@@ -202,7 +202,7 @@ class CasAdminApplication(object):
os.makedirs(os.path.dirname(DATABASE))
if not os.path.isdir(DEBUGS):
os.makedirs(DEBUGS)
-
+
# if autopurge is enabled lets clean up some stale data
if AUTOPURGE == 'yes' or AUTOPURGE == 'y':
self.casLog.debug('Autopurge enabled, begin cleanup')
diff --git a/cas-admin.1 b/cas-admin.1
index 2369f53..61c4045 100644
--- a/cas-admin.1
+++ b/cas-admin.1
@@ -13,6 +13,7 @@ Populate server database for automatic processing of core files.
.TP
.B \-b
Populate a database with debug kernel information.
+.TP
.B \-p
Purge data based on set days (see purge options)
.SH PURGE OPTIONS
@@ -26,7 +27,7 @@ Written by Adam Stokes
.SH "REPORTING BUGS"
Report bugs to <astokes(a)redhat.com>.
.SH COPYRIGHT
-Copyright \(co 2007-2008 Adam Stokes
+Copyright \(co 2007-2009 Adam Stokes
.br
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
diff --git a/cas.1 b/cas.1
index 81c1ae6..8c41ed7 100644
--- a/cas.1
+++ b/cas.1
@@ -16,8 +16,11 @@ some sort.
.BI \-f " file"
Define a core file to be processed.
.TP
-.BI \-m " email"
+.BI \-e " email"
Provide an email address for result notification
+.TP
+.B \-m
+Extract current loaded modules from debug kernels.
.SH RESOURCES
A configuration file is maintained in /etc/cas.conf.
.SH AUTHOR
@@ -25,7 +28,7 @@ Written by Adam Stokes
.SH "REPORTING BUGS"
Report bugs to <astokes(a)redhat.com>.
.SH COPYRIGHT
-Copyright \(co 2007-2008 Adam Stokes
+Copyright \(co 2007-2009 Adam Stokes
.br
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
15 years
cas-admin cas.conf
by Adam Stokes
cas-admin | 2 +-
cas.conf | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 2caa816ba775bdb98f3278f58e07978de37a36f4
Author: Adam Stokes <adam.stokes(a)gmail.com>
Date: Tue May 5 18:46:55 2009 -0400
- fix purge code
diff --git a/cas-admin b/cas-admin
index 98b7489..2e3d9b3 100755
--- a/cas-admin
+++ b/cas-admin
@@ -204,7 +204,7 @@ class CasAdminApplication(object):
os.makedirs(DEBUGS)
# if autopurge is enabled lets clean up some stale data
- if AUTOPURGE:
+ if AUTOPURGE == 'yes' or AUTOPURGE == 'y':
self.casLog.debug('Autopurge enabled, begin cleanup')
purgeHandler = PurgeHandler(int(PURGELIMIT), self.casLog).run()
diff --git a/cas.conf b/cas.conf
index 75a6609..963f3b7 100644
--- a/cas.conf
+++ b/cas.conf
@@ -34,7 +34,7 @@ purgeLimit=90
# Enable if want to automatically check and purge data
# whenever cas-admin is run
-autoPurge=False
+autoPurge=Yes
[advanced]
# if running a x86_64 system and wish to analyze 32bit
15 years
cas cas-admin lib/cas
by Adam Stokes
cas | 6 +++---
cas-admin | 6 +++---
lib/cas/core.py | 2 +-
lib/cas/rpmutils.py | 2 +-
lib/cas/util.py | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit f069a3b5724dc5de35bd4f39c579b79eece61e59
Author: Adam Stokes <adam.stokes(a)gmail.com>
Date: Tue May 5 18:28:18 2009 -0400
- re-work cas to work on python 2.3
diff --git a/cas b/cas
index 989d6c3..a376b69 100755
--- a/cas
+++ b/cas
@@ -21,7 +21,7 @@ import ConfigParser
import smtplib
import socket
-from subprocess import Popen, PIPE
+from cas.cas_subprocess import Popen, PIPE
from datetime import datetime
from cas.network import Download, CasNetworkException
@@ -34,8 +34,8 @@ from cas.rpmutils import RPMBase
# mainly in the _move_ method.
import cas.cas_shutil as shutil
-if sys.version_info[:2] < (2,4):
- raise SystemExit("Python >= 2.4 required")
+if sys.version_info[:2] < (2,3):
+ raise SystemExit("Python >= 2.3 required")
# Configuration parsing of /etc/cas.conf
config = ConfigParser.ConfigParser()
diff --git a/cas-admin b/cas-admin
index 1d11447..98b7489 100755
--- a/cas-admin
+++ b/cas-admin
@@ -26,11 +26,11 @@ from cas.core import CoreBase
from cas.util import UtilBase, Logging
from cas.rpmutils import RPMBase
from cas.db import CasStorage, CasStorageException
-from subprocess import Popen, PIPE
+from cas.cas_subprocess import Popen, PIPE
from cas.cas_shutil import rmtree
-if sys.version_info[:2] < (2,4):
- raise SystemExit("Python >= 2.4 required")
+if sys.version_info[:2] < (2,3):
+ raise SystemExit("Python >= 2.3 required")
# Read in configuration
config = ConfigParser.ConfigParser()
diff --git a/lib/cas/core.py b/lib/cas/core.py
index d3cd0db..f4558d5 100644
--- a/lib/cas/core.py
+++ b/lib/cas/core.py
@@ -13,7 +13,7 @@
import os
from cas.util import UtilBase
-from subprocess import Popen, PIPE, call
+from cas.cas_subprocess import Popen, PIPE, call
class CoreException(Exception):
pass
diff --git a/lib/cas/rpmutils.py b/lib/cas/rpmutils.py
index 170fcf4..5a65371 100644
--- a/lib/cas/rpmutils.py
+++ b/lib/cas/rpmutils.py
@@ -18,7 +18,7 @@ import logging
import md5
import time
-from subprocess import Popen, PIPE
+from cas.cas_subprocess import Popen, PIPE
class RPMException(Exception): pass
diff --git a/lib/cas/util.py b/lib/cas/util.py
index fb7bad1..9c03539 100644
--- a/lib/cas/util.py
+++ b/lib/cas/util.py
@@ -19,7 +19,7 @@ import sys
import logging
import cas.cas_shutil as shutil
-from subprocess import Popen, PIPE, call
+from cas.cas_subprocess import Popen, PIPE, call
class Logging(object):
def __init__(self, dst, logger_id, debug_level='DEBUG'):
15 years
doc/index.rst
by Adam Stokes
doc/index.rst | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit a9aba30456c8c45ae28260c89f0bd4938d7bf1fa
Author: uzr <uzr(a)shinzo.(none)>
Date: Tue May 5 18:23:35 2009 -0400
-work done on docs
diff --git a/doc/index.rst b/doc/index.rst
index 5bf0bb1..3c9cb59 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -55,6 +55,9 @@ each section and describe its meaning::
workDirectory=/cores/processed
mailServer=mail.example.com
database=/var/db/cas/cas.db
+ [maintenance]
+ purgeLimit=90
+ autoPurge=False
[advanced]
# crash_32=/usr/local/i386/crash
@@ -83,6 +86,12 @@ require smtp authentication.
``database``: (**Required**) Define where the sqlite database will reside.
+``purgeLimit``: Define amount of day(s) back wish to keep physical data on
+system.
+
+``autoPurge``: True/False setting if wanting cas-admin to auto purge stale data on
+each run.
+
``crash_32``: Primarily used on x86_64 systems to process x86 cores. If x86
version of crash is installed this directive can be set to the crash binary
and CAS will automatically process x86 cores on a x86_64 machine. ``Note`` this
@@ -123,6 +132,9 @@ following::
workDirectory=/cores
mailServer=mail.cas-server.com
database=/var/db/cas/cas.db
+ [maintenance]
+ purgeLimit=90
+ autoPurge=False
[advanced]
crash_32=/usr/local/i386/crash
15 years
lib/cas
by Adam Stokes
lib/cas/cas_subprocess.py | 1294 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 1294 insertions(+)
New commits:
commit 410d48d646a761b26a1ae95539b0f585a9851f50
Author: uzr <uzr(a)shinzo.(none)>
Date: Tue May 5 18:22:56 2009 -0400
- adding subprocess from python 2.6 to enable cas to
run on python v2.3 for rhel4
diff --git a/lib/cas/cas_subprocess.py b/lib/cas/cas_subprocess.py
new file mode 100644
index 0000000..935827a
--- /dev/null
+++ b/lib/cas/cas_subprocess.py
@@ -0,0 +1,1294 @@
+# subprocess - Subprocesses with accessible I/O streams
+#
+# For more information about this module, see PEP 324.
+#
+# This module should remain compatible with Python 2.2, see PEP 291.
+#
+# Copyright (c) 2003-2005 by Peter Astrand <astrand(a)lysator.liu.se>
+#
+# Licensed to PSF under a Contributor Agreement.
+# See http://www.python.org/2.4/license for licensing details.
+
+r"""subprocess - Subprocesses with accessible I/O streams
+
+This module allows you to spawn processes, connect to their
+input/output/error pipes, and obtain their return codes. This module
+intends to replace several other, older modules and functions, like:
+
+os.system
+os.spawn*
+os.popen*
+popen2.*
+commands.*
+
+Information about how the subprocess module can be used to replace these
+modules and functions can be found below.
+
+
+
+Using the subprocess module
+===========================
+This module defines one class called Popen:
+
+class Popen(args, bufsize=0, executable=None,
+ stdin=None, stdout=None, stderr=None,
+ preexec_fn=None, close_fds=False, shell=False,
+ cwd=None, env=None, universal_newlines=False,
+ startupinfo=None, creationflags=0):
+
+
+Arguments are:
+
+args should be a string, or a sequence of program arguments. The
+program to execute is normally the first item in the args sequence or
+string, but can be explicitly set by using the executable argument.
+
+On UNIX, with shell=False (default): In this case, the Popen class
+uses os.execvp() to execute the child program. args should normally
+be a sequence. A string will be treated as a sequence with the string
+as the only item (the program to execute).
+
+On UNIX, with shell=True: If args is a string, it specifies the
+command string to execute through the shell. If args is a sequence,
+the first item specifies the command string, and any additional items
+will be treated as additional shell arguments.
+
+On Windows: the Popen class uses CreateProcess() to execute the child
+program, which operates on strings. If args is a sequence, it will be
+converted to a string using the list2cmdline method. Please note that
+not all MS Windows applications interpret the command line the same
+way: The list2cmdline is designed for applications using the same
+rules as the MS C runtime.
+
+bufsize, if given, has the same meaning as the corresponding argument
+to the built-in open() function: 0 means unbuffered, 1 means line
+buffered, any other positive value means use a buffer of
+(approximately) that size. A negative bufsize means to use the system
+default, which usually means fully buffered. The default value for
+bufsize is 0 (unbuffered).
+
+stdin, stdout and stderr specify the executed programs' standard
+input, standard output and standard error file handles, respectively.
+Valid values are PIPE, an existing file descriptor (a positive
+integer), an existing file object, and None. PIPE indicates that a
+new pipe to the child should be created. With None, no redirection
+will occur; the child's file handles will be inherited from the
+parent. Additionally, stderr can be STDOUT, which indicates that the
+stderr data from the applications should be captured into the same
+file handle as for stdout.
+
+If preexec_fn is set to a callable object, this object will be called
+in the child process just before the child is executed.
+
+If close_fds is true, all file descriptors except 0, 1 and 2 will be
+closed before the child process is executed.
+
+if shell is true, the specified command will be executed through the
+shell.
+
+If cwd is not None, the current directory will be changed to cwd
+before the child is executed.
+
+If env is not None, it defines the environment variables for the new
+process.
+
+If universal_newlines is true, the file objects stdout and stderr are
+opened as a text files, but lines may be terminated by any of '\n',
+the Unix end-of-line convention, '\r', the Macintosh convention or
+'\r\n', the Windows convention. All of these external representations
+are seen as '\n' by the Python program. Note: This feature is only
+available if Python is built with universal newline support (the
+default). Also, the newlines attribute of the file objects stdout,
+stdin and stderr are not updated by the communicate() method.
+
+The startupinfo and creationflags, if given, will be passed to the
+underlying CreateProcess() function. They can specify things such as
+appearance of the main window and priority for the new process.
+(Windows only)
+
+
+This module also defines two shortcut functions:
+
+call(*popenargs, **kwargs):
+ Run command with arguments. Wait for command to complete, then
+ return the returncode attribute.
+
+ The arguments are the same as for the Popen constructor. Example:
+
+ retcode = call(["ls", "-l"])
+
+check_call(*popenargs, **kwargs):
+ Run command with arguments. Wait for command to complete. If the
+ exit code was zero then return, otherwise raise
+ CalledProcessError. The CalledProcessError object will have the
+ return code in the returncode attribute.
+
+ The arguments are the same as for the Popen constructor. Example:
+
+ check_call(["ls", "-l"])
+
+Exceptions
+----------
+Exceptions raised in the child process, before the new program has
+started to execute, will be re-raised in the parent. Additionally,
+the exception object will have one extra attribute called
+'child_traceback', which is a string containing traceback information
+from the childs point of view.
+
+The most common exception raised is OSError. This occurs, for
+example, when trying to execute a non-existent file. Applications
+should prepare for OSErrors.
+
+A ValueError will be raised if Popen is called with invalid arguments.
+
+check_call() will raise CalledProcessError, if the called process
+returns a non-zero return code.
+
+
+Security
+--------
+Unlike some other popen functions, this implementation will never call
+/bin/sh implicitly. This means that all characters, including shell
+metacharacters, can safely be passed to child processes.
+
+
+Popen objects
+=============
+Instances of the Popen class have the following methods:
+
+poll()
+ Check if child process has terminated. Returns returncode
+ attribute.
+
+wait()
+ Wait for child process to terminate. Returns returncode attribute.
+
+communicate(input=None)
+ Interact with process: Send data to stdin. Read data from stdout
+ and stderr, until end-of-file is reached. Wait for process to
+ terminate. The optional input argument should be a string to be
+ sent to the child process, or None, if no data should be sent to
+ the child.
+
+ communicate() returns a tuple (stdout, stderr).
+
+ Note: The data read is buffered in memory, so do not use this
+ method if the data size is large or unlimited.
+
+The following attributes are also available:
+
+stdin
+ If the stdin argument is PIPE, this attribute is a file object
+ that provides input to the child process. Otherwise, it is None.
+
+stdout
+ If the stdout argument is PIPE, this attribute is a file object
+ that provides output from the child process. Otherwise, it is
+ None.
+
+stderr
+ If the stderr argument is PIPE, this attribute is file object that
+ provides error output from the child process. Otherwise, it is
+ None.
+
+pid
+ The process ID of the child process.
+
+returncode
+ The child return code. A None value indicates that the process
+ hasn't terminated yet. A negative value -N indicates that the
+ child was terminated by signal N (UNIX only).
+
+
+Replacing older functions with the subprocess module
+====================================================
+In this section, "a ==> b" means that b can be used as a replacement
+for a.
+
+Note: All functions in this section fail (more or less) silently if
+the executed program cannot be found; this module raises an OSError
+exception.
+
+In the following examples, we assume that the subprocess module is
+imported with "from subprocess import *".
+
+
+Replacing /bin/sh shell backquote
+---------------------------------
+output=`mycmd myarg`
+==>
+output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]
+
+
+Replacing shell pipe line
+-------------------------
+output=`dmesg | grep hda`
+==>
+p1 = Popen(["dmesg"], stdout=PIPE)
+p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
+output = p2.communicate()[0]
+
+
+Replacing os.system()
+---------------------
+sts = os.system("mycmd" + " myarg")
+==>
+p = Popen("mycmd" + " myarg", shell=True)
+pid, sts = os.waitpid(p.pid, 0)
+
+Note:
+
+* Calling the program through the shell is usually not required.
+
+* It's easier to look at the returncode attribute than the
+ exitstatus.
+
+A more real-world example would look like this:
+
+try:
+ retcode = call("mycmd" + " myarg", shell=True)
+ if retcode < 0:
+ print >>sys.stderr, "Child was terminated by signal", -retcode
+ else:
+ print >>sys.stderr, "Child returned", retcode
+except OSError, e:
+ print >>sys.stderr, "Execution failed:", e
+
+
+Replacing os.spawn*
+-------------------
+P_NOWAIT example:
+
+pid = os.spawnlp(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg")
+==>
+pid = Popen(["/bin/mycmd", "myarg"]).pid
+
+
+P_WAIT example:
+
+retcode = os.spawnlp(os.P_WAIT, "/bin/mycmd", "mycmd", "myarg")
+==>
+retcode = call(["/bin/mycmd", "myarg"])
+
+
+Vector example:
+
+os.spawnvp(os.P_NOWAIT, path, args)
+==>
+Popen([path] + args[1:])
+
+
+Environment example:
+
+os.spawnlpe(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg", env)
+==>
+Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"})
+
+
+Replacing os.popen*
+-------------------
+pipe = os.popen(cmd, mode='r', bufsize)
+==>
+pipe = Popen(cmd, shell=True, bufsize=bufsize, stdout=PIPE).stdout
+
+pipe = os.popen(cmd, mode='w', bufsize)
+==>
+pipe = Popen(cmd, shell=True, bufsize=bufsize, stdin=PIPE).stdin
+
+
+(child_stdin, child_stdout) = os.popen2(cmd, mode, bufsize)
+==>
+p = Popen(cmd, shell=True, bufsize=bufsize,
+ stdin=PIPE, stdout=PIPE, close_fds=True)
+(child_stdin, child_stdout) = (p.stdin, p.stdout)
+
+
+(child_stdin,
+ child_stdout,
+ child_stderr) = os.popen3(cmd, mode, bufsize)
+==>
+p = Popen(cmd, shell=True, bufsize=bufsize,
+ stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
+(child_stdin,
+ child_stdout,
+ child_stderr) = (p.stdin, p.stdout, p.stderr)
+
+
+(child_stdin, child_stdout_and_stderr) = os.popen4(cmd, mode, bufsize)
+==>
+p = Popen(cmd, shell=True, bufsize=bufsize,
+ stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
+(child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout)
+
+
+Replacing popen2.*
+------------------
+Note: If the cmd argument to popen2 functions is a string, the command
+is executed through /bin/sh. If it is a list, the command is directly
+executed.
+
+(child_stdout, child_stdin) = popen2.popen2("somestring", bufsize, mode)
+==>
+p = Popen(["somestring"], shell=True, bufsize=bufsize
+ stdin=PIPE, stdout=PIPE, close_fds=True)
+(child_stdout, child_stdin) = (p.stdout, p.stdin)
+
+
+(child_stdout, child_stdin) = popen2.popen2(["mycmd", "myarg"], bufsize, mode)
+==>
+p = Popen(["mycmd", "myarg"], bufsize=bufsize,
+ stdin=PIPE, stdout=PIPE, close_fds=True)
+(child_stdout, child_stdin) = (p.stdout, p.stdin)
+
+The popen2.Popen3 and popen2.Popen4 basically works as subprocess.Popen,
+except that:
+
+* subprocess.Popen raises an exception if the execution fails
+* the capturestderr argument is replaced with the stderr argument.
+* stdin=PIPE and stdout=PIPE must be specified.
+* popen2 closes all filedescriptors by default, but you have to specify
+ close_fds=True with subprocess.Popen.
+"""
+
+import sys
+mswindows = (sys.platform == "win32")
+
+import os
+import types
+import traceback
+import gc
+import signal
+
+# Exception classes used by this module.
+class CalledProcessError(Exception):
+ """This exception is raised when a process run by check_call() returns
+ a non-zero exit status. The exit status will be stored in the
+ returncode attribute."""
+ def __init__(self, returncode, cmd):
+ self.returncode = returncode
+ self.cmd = cmd
+ def __str__(self):
+ return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
+
+
+if mswindows:
+ import threading
+ import msvcrt
+ if 0: # <-- change this to use pywin32 instead of the _subprocess driver
+ import pywintypes
+ from win32api import GetStdHandle, STD_INPUT_HANDLE, \
+ STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
+ from win32api import GetCurrentProcess, DuplicateHandle, \
+ GetModuleFileName, GetVersion
+ from win32con import DUPLICATE_SAME_ACCESS, SW_HIDE
+ from win32pipe import CreatePipe
+ from win32process import CreateProcess, STARTUPINFO, \
+ GetExitCodeProcess, STARTF_USESTDHANDLES, \
+ STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE
+ from win32process import TerminateProcess
+ from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0
+ else:
+ from _subprocess import *
+ class STARTUPINFO:
+ dwFlags = 0
+ hStdInput = None
+ hStdOutput = None
+ hStdError = None
+ wShowWindow = 0
+ class pywintypes:
+ error = IOError
+else:
+ import select
+ import errno
+ import fcntl
+ import pickle
+
+__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "CalledProcessError"]
+
+try:
+ MAXFD = os.sysconf("SC_OPEN_MAX")
+except:
+ MAXFD = 256
+
+# True/False does not exist on 2.2.0
+#try:
+# False
+#except NameError:
+# False = 0
+# True = 1
+
+_active = []
+
+def _cleanup():
+ for inst in _active[:]:
+ if inst._internal_poll(_deadstate=sys.maxint) >= 0:
+ try:
+ _active.remove(inst)
+ except ValueError:
+ # This can happen if two threads create a new Popen instance.
+ # It's harmless that it was already removed, so ignore.
+ pass
+
+PIPE = -1
+STDOUT = -2
+
+
+def call(*popenargs, **kwargs):
+ """Run command with arguments. Wait for command to complete, then
+ return the returncode attribute.
+
+ The arguments are the same as for the Popen constructor. Example:
+
+ retcode = call(["ls", "-l"])
+ """
+ return Popen(*popenargs, **kwargs).wait()
+
+
+def check_call(*popenargs, **kwargs):
+ """Run command with arguments. Wait for command to complete. If
+ the exit code was zero then return, otherwise raise
+ CalledProcessError. The CalledProcessError object will have the
+ return code in the returncode attribute.
+
+ The arguments are the same as for the Popen constructor. Example:
+
+ check_call(["ls", "-l"])
+ """
+ retcode = call(*popenargs, **kwargs)
+ cmd = kwargs.get("args")
+ if cmd is None:
+ cmd = popenargs[0]
+ if retcode:
+ raise CalledProcessError(retcode, cmd)
+ return retcode
+
+
+def list2cmdline(seq):
+ """
+ Translate a sequence of arguments into a command line
+ string, using the same rules as the MS C runtime:
+
+ 1) Arguments are delimited by white space, which is either a
+ space or a tab.
+
+ 2) A string surrounded by double quotation marks is
+ interpreted as a single argument, regardless of white space
+ or pipe characters contained within. A quoted string can be
+ embedded in an argument.
+
+ 3) A double quotation mark preceded by a backslash is
+ interpreted as a literal double quotation mark.
+
+ 4) Backslashes are interpreted literally, unless they
+ immediately precede a double quotation mark.
+
+ 5) If backslashes immediately precede a double quotation mark,
+ every pair of backslashes is interpreted as a literal
+ backslash. If the number of backslashes is odd, the last
+ backslash escapes the next double quotation mark as
+ described in rule 3.
+ """
+
+ # See
+ # http://msdn.microsoft.com/library/en-us/vccelng/htm/progs_12.asp
+ result = []
+ needquote = False
+ for arg in seq:
+ bs_buf = []
+
+ # Add a space to separate this argument from the others
+ if result:
+ result.append(' ')
+
+ needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg
+ if needquote:
+ result.append('"')
+
+ for c in arg:
+ if c == '\\':
+ # Don't know if we need to double yet.
+ bs_buf.append(c)
+ elif c == '"':
+ # Double backslashes.
+ result.append('\\' * len(bs_buf)*2)
+ bs_buf = []
+ result.append('\\"')
+ else:
+ # Normal char
+ if bs_buf:
+ result.extend(bs_buf)
+ bs_buf = []
+ result.append(c)
+
+ # Add remaining backslashes, if any.
+ if bs_buf:
+ result.extend(bs_buf)
+
+ if needquote:
+ result.extend(bs_buf)
+ result.append('"')
+
+ return ''.join(result)
+
+
+class Popen(object):
+ def __init__(self, args, bufsize=0, executable=None,
+ stdin=None, stdout=None, stderr=None,
+ preexec_fn=None, close_fds=False, shell=False,
+ cwd=None, env=None, universal_newlines=False,
+ startupinfo=None, creationflags=0):
+ """Create new Popen instance."""
+ _cleanup()
+
+ self._child_created = False
+ if not isinstance(bufsize, (int, long)):
+ raise TypeError("bufsize must be an integer")
+
+ if mswindows:
+ if preexec_fn is not None:
+ raise ValueError("preexec_fn is not supported on Windows "
+ "platforms")
+ if close_fds and (stdin is not None or stdout is not None or
+ stderr is not None):
+ raise ValueError("close_fds is not supported on Windows "
+ "platforms if you redirect stdin/stdout/stderr")
+ else:
+ # POSIX
+ if startupinfo is not None:
+ raise ValueError("startupinfo is only supported on Windows "
+ "platforms")
+ if creationflags != 0:
+ raise ValueError("creationflags is only supported on Windows "
+ "platforms")
+
+ self.stdin = None
+ self.stdout = None
+ self.stderr = None
+ self.pid = None
+ self.returncode = None
+ self.universal_newlines = universal_newlines
+
+ # Input and output objects. The general principle is like
+ # this:
+ #
+ # Parent Child
+ # ------ -----
+ # p2cwrite ---stdin---> p2cread
+ # c2pread <--stdout--- c2pwrite
+ # errread <--stderr--- errwrite
+ #
+ # On POSIX, the child objects are file descriptors. On
+ # Windows, these are Windows file handles. The parent objects
+ # are file descriptors on both platforms. The parent objects
+ # are None when not using PIPEs. The child objects are None
+ # when not redirecting.
+
+ (p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite) = self._get_handles(stdin, stdout, stderr)
+
+ self._execute_child(args, executable, preexec_fn, close_fds,
+ cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite)
+
+ # On Windows, you cannot just redirect one or two handles: You
+ # either have to redirect all three or none. If the subprocess
+ # user has only redirected one or two handles, we are
+ # automatically creating PIPEs for the rest. We should close
+ # these after the process is started. See bug #1124861.
+ if mswindows:
+ if stdin is None and p2cwrite is not None:
+ os.close(p2cwrite)
+ p2cwrite = None
+ if stdout is None and c2pread is not None:
+ os.close(c2pread)
+ c2pread = None
+ if stderr is None and errread is not None:
+ os.close(errread)
+ errread = None
+
+ if p2cwrite is not None:
+ self.stdin = os.fdopen(p2cwrite, 'wb', bufsize)
+ if c2pread is not None:
+ if universal_newlines:
+ self.stdout = os.fdopen(c2pread, 'rU', bufsize)
+ else:
+ self.stdout = os.fdopen(c2pread, 'rb', bufsize)
+ if errread is not None:
+ if universal_newlines:
+ self.stderr = os.fdopen(errread, 'rU', bufsize)
+ else:
+ self.stderr = os.fdopen(errread, 'rb', bufsize)
+
+
+ def _translate_newlines(self, data):
+ data = data.replace("\r\n", "\n")
+ data = data.replace("\r", "\n")
+ return data
+
+
+ def __del__(self, sys=sys):
+ if not self._child_created:
+ # We didn't get to successfully create a child process.
+ return
+ # In case the child hasn't been waited on, check if it's done.
+ self._internal_poll(_deadstate=sys.maxint)
+ if self.returncode is None and _active is not None:
+ # Child is still running, keep us alive until we can wait on it.
+ _active.append(self)
+
+
+ def communicate(self, input=None):
+ """Interact with process: Send data to stdin. Read data from
+ stdout and stderr, until end-of-file is reached. Wait for
+ process to terminate. The optional input argument should be a
+ string to be sent to the child process, or None, if no data
+ should be sent to the child.
+
+ communicate() returns a tuple (stdout, stderr)."""
+
+ # Optimization: If we are only using one pipe, or no pipe at
+ # all, using select() or threads is unnecessary.
+ if [self.stdin, self.stdout, self.stderr].count(None) >= 2:
+ stdout = None
+ stderr = None
+ if self.stdin:
+ if input:
+ self.stdin.write(input)
+ self.stdin.close()
+ elif self.stdout:
+ stdout = self.stdout.read()
+ self.stdout.close()
+ elif self.stderr:
+ stderr = self.stderr.read()
+ self.stderr.close()
+ self.wait()
+ return (stdout, stderr)
+
+ return self._communicate(input)
+
+
+ def poll(self):
+ return self._internal_poll()
+
+
+ if mswindows:
+ #
+ # Windows methods
+ #
+ def _get_handles(self, stdin, stdout, stderr):
+ """Construct and return tupel with IO objects:
+ p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
+ """
+ if stdin is None and stdout is None and stderr is None:
+ return (None, None, None, None, None, None)
+
+ p2cread, p2cwrite = None, None
+ c2pread, c2pwrite = None, None
+ errread, errwrite = None, None
+
+ if stdin is None:
+ p2cread = GetStdHandle(STD_INPUT_HANDLE)
+ if p2cread is not None:
+ pass
+ elif stdin is None or stdin == PIPE:
+ p2cread, p2cwrite = CreatePipe(None, 0)
+ # Detach and turn into fd
+ p2cwrite = p2cwrite.Detach()
+ p2cwrite = msvcrt.open_osfhandle(p2cwrite, 0)
+ elif isinstance(stdin, int):
+ p2cread = msvcrt.get_osfhandle(stdin)
+ else:
+ # Assuming file-like object
+ p2cread = msvcrt.get_osfhandle(stdin.fileno())
+ p2cread = self._make_inheritable(p2cread)
+
+ if stdout is None:
+ c2pwrite = GetStdHandle(STD_OUTPUT_HANDLE)
+ if c2pwrite is not None:
+ pass
+ elif stdout is None or stdout == PIPE:
+ c2pread, c2pwrite = CreatePipe(None, 0)
+ # Detach and turn into fd
+ c2pread = c2pread.Detach()
+ c2pread = msvcrt.open_osfhandle(c2pread, 0)
+ elif isinstance(stdout, int):
+ c2pwrite = msvcrt.get_osfhandle(stdout)
+ else:
+ # Assuming file-like object
+ c2pwrite = msvcrt.get_osfhandle(stdout.fileno())
+ c2pwrite = self._make_inheritable(c2pwrite)
+
+ if stderr is None:
+ errwrite = GetStdHandle(STD_ERROR_HANDLE)
+ if errwrite is not None:
+ pass
+ elif stderr is None or stderr == PIPE:
+ errread, errwrite = CreatePipe(None, 0)
+ # Detach and turn into fd
+ errread = errread.Detach()
+ errread = msvcrt.open_osfhandle(errread, 0)
+ elif stderr == STDOUT:
+ errwrite = c2pwrite
+ elif isinstance(stderr, int):
+ errwrite = msvcrt.get_osfhandle(stderr)
+ else:
+ # Assuming file-like object
+ errwrite = msvcrt.get_osfhandle(stderr.fileno())
+ errwrite = self._make_inheritable(errwrite)
+
+ return (p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite)
+
+
+ def _make_inheritable(self, handle):
+ """Return a duplicate of handle, which is inheritable"""
+ return DuplicateHandle(GetCurrentProcess(), handle,
+ GetCurrentProcess(), 0, 1,
+ DUPLICATE_SAME_ACCESS)
+
+
+ def _find_w9xpopen(self):
+ """Find and return absolut path to w9xpopen.exe"""
+ w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)),
+ "w9xpopen.exe")
+ if not os.path.exists(w9xpopen):
+ # Eeek - file-not-found - possibly an embedding
+ # situation - see if we can locate it in sys.exec_prefix
+ w9xpopen = os.path.join(os.path.dirname(sys.exec_prefix),
+ "w9xpopen.exe")
+ if not os.path.exists(w9xpopen):
+ raise RuntimeError("Cannot locate w9xpopen.exe, which is "
+ "needed for Popen to work with your "
+ "shell or platform.")
+ return w9xpopen
+
+
+ def _execute_child(self, args, executable, preexec_fn, close_fds,
+ cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite):
+ """Execute program (MS Windows version)"""
+
+ if not isinstance(args, types.StringTypes):
+ args = list2cmdline(args)
+
+ # Process startup details
+ if startupinfo is None:
+ startupinfo = STARTUPINFO()
+ if None not in (p2cread, c2pwrite, errwrite):
+ startupinfo.dwFlags |= STARTF_USESTDHANDLES
+ startupinfo.hStdInput = p2cread
+ startupinfo.hStdOutput = c2pwrite
+ startupinfo.hStdError = errwrite
+
+ if shell:
+ startupinfo.dwFlags |= STARTF_USESHOWWINDOW
+ startupinfo.wShowWindow = SW_HIDE
+ comspec = os.environ.get("COMSPEC", "cmd.exe")
+ args = comspec + " /c " + args
+ if (GetVersion() >= 0x80000000L or
+ os.path.basename(comspec).lower() == "command.com"):
+ # Win9x, or using command.com on NT. We need to
+ # use the w9xpopen intermediate program. For more
+ # information, see KB Q150956
+ # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/su...)
+ w9xpopen = self._find_w9xpopen()
+ args = '"%s" %s' % (w9xpopen, args)
+ # Not passing CREATE_NEW_CONSOLE has been known to
+ # cause random failures on win9x. Specifically a
+ # dialog: "Your program accessed mem currently in
+ # use at xxx" and a hopeful warning about the
+ # stability of your system. Cost is Ctrl+C wont
+ # kill children.
+ creationflags |= CREATE_NEW_CONSOLE
+
+ # Start the process
+ try:
+ hp, ht, pid, tid = CreateProcess(executable, args,
+ # no special security
+ None, None,
+ int(not close_fds),
+ creationflags,
+ env,
+ cwd,
+ startupinfo)
+ except pywintypes.error, e:
+ # Translate pywintypes.error to WindowsError, which is
+ # a subclass of OSError. FIXME: We should really
+ # translate errno using _sys_errlist (or simliar), but
+ # how can this be done from Python?
+ raise WindowsError(*e.args)
+
+ # Retain the process handle, but close the thread handle
+ self._child_created = True
+ self._handle = hp
+ self.pid = pid
+ ht.Close()
+
+ # Child is launched. Close the parent's copy of those pipe
+ # handles that only the child should have open. You need
+ # to make sure that no handles to the write end of the
+ # output pipe are maintained in this process or else the
+ # pipe will not close when the child process exits and the
+ # ReadFile will hang.
+ if p2cread is not None:
+ p2cread.Close()
+ if c2pwrite is not None:
+ c2pwrite.Close()
+ if errwrite is not None:
+ errwrite.Close()
+
+
+ def _internal_poll(self, _deadstate=None):
+ """Check if child process has terminated. Returns returncode
+ attribute."""
+ if self.returncode is None:
+ if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0:
+ self.returncode = GetExitCodeProcess(self._handle)
+ return self.returncode
+
+
+ def wait(self):
+ """Wait for child process to terminate. Returns returncode
+ attribute."""
+ if self.returncode is None:
+ obj = WaitForSingleObject(self._handle, INFINITE)
+ self.returncode = GetExitCodeProcess(self._handle)
+ return self.returncode
+
+
+ def _readerthread(self, fh, buffer):
+ buffer.append(fh.read())
+
+
+ def _communicate(self, input):
+ stdout = None # Return
+ stderr = None # Return
+
+ if self.stdout:
+ stdout = []
+ stdout_thread = threading.Thread(target=self._readerthread,
+ args=(self.stdout, stdout))
+ stdout_thread.setDaemon(True)
+ stdout_thread.start()
+ if self.stderr:
+ stderr = []
+ stderr_thread = threading.Thread(target=self._readerthread,
+ args=(self.stderr, stderr))
+ stderr_thread.setDaemon(True)
+ stderr_thread.start()
+
+ if self.stdin:
+ if input is not None:
+ self.stdin.write(input)
+ self.stdin.close()
+
+ if self.stdout:
+ stdout_thread.join()
+ if self.stderr:
+ stderr_thread.join()
+
+ # All data exchanged. Translate lists into strings.
+ if stdout is not None:
+ stdout = stdout[0]
+ if stderr is not None:
+ stderr = stderr[0]
+
+ # Translate newlines, if requested. We cannot let the file
+ # object do the translation: It is based on stdio, which is
+ # impossible to combine with select (unless forcing no
+ # buffering).
+ if self.universal_newlines and hasattr(file, 'newlines'):
+ if stdout:
+ stdout = self._translate_newlines(stdout)
+ if stderr:
+ stderr = self._translate_newlines(stderr)
+
+ self.wait()
+ return (stdout, stderr)
+
+ def send_signal(self, sig):
+ """Send a signal to the process
+ """
+ if sig == signal.SIGTERM:
+ self.terminate()
+ else:
+ raise ValueError("Only SIGTERM is supported on Windows")
+
+ def terminate(self):
+ """Terminates the process
+ """
+ TerminateProcess(self._handle, 1)
+
+ kill = terminate
+
+ else:
+ #
+ # POSIX methods
+ #
+ def _get_handles(self, stdin, stdout, stderr):
+ """Construct and return tupel with IO objects:
+ p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
+ """
+ p2cread, p2cwrite = None, None
+ c2pread, c2pwrite = None, None
+ errread, errwrite = None, None
+
+ if stdin is None:
+ pass
+ elif stdin == PIPE:
+ p2cread, p2cwrite = os.pipe()
+ elif isinstance(stdin, int):
+ p2cread = stdin
+ else:
+ # Assuming file-like object
+ p2cread = stdin.fileno()
+
+ if stdout is None:
+ pass
+ elif stdout == PIPE:
+ c2pread, c2pwrite = os.pipe()
+ elif isinstance(stdout, int):
+ c2pwrite = stdout
+ else:
+ # Assuming file-like object
+ c2pwrite = stdout.fileno()
+
+ if stderr is None:
+ pass
+ elif stderr == PIPE:
+ errread, errwrite = os.pipe()
+ elif stderr == STDOUT:
+ errwrite = c2pwrite
+ elif isinstance(stderr, int):
+ errwrite = stderr
+ else:
+ # Assuming file-like object
+ errwrite = stderr.fileno()
+
+ return (p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite)
+
+
+ def _set_cloexec_flag(self, fd):
+ try:
+ cloexec_flag = fcntl.FD_CLOEXEC
+ except AttributeError:
+ cloexec_flag = 1
+
+ old = fcntl.fcntl(fd, fcntl.F_GETFD)
+ fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag)
+
+
+ def _close_fds(self, but):
+ os.closerange(3, but)
+ os.closerange(but + 1, MAXFD)
+
+
+ def _execute_child(self, args, executable, preexec_fn, close_fds,
+ cwd, env, universal_newlines,
+ startupinfo, creationflags, shell,
+ p2cread, p2cwrite,
+ c2pread, c2pwrite,
+ errread, errwrite):
+ """Execute program (POSIX version)"""
+
+ if isinstance(args, types.StringTypes):
+ args = [args]
+ else:
+ args = list(args)
+
+ if shell:
+ args = ["/bin/sh", "-c"] + args
+
+ if executable is None:
+ executable = args[0]
+
+ # For transferring possible exec failure from child to parent
+ # The first char specifies the exception type: 0 means
+ # OSError, 1 means some other error.
+ errpipe_read, errpipe_write = os.pipe()
+ self._set_cloexec_flag(errpipe_write)
+
+ gc_was_enabled = gc.isenabled()
+ # Disable gc to avoid bug where gc -> file_dealloc ->
+ # write to stderr -> hang. http://bugs.python.org/issue1336
+ gc.disable()
+ try:
+ self.pid = os.fork()
+ except:
+ if gc_was_enabled:
+ gc.enable()
+ raise
+ self._child_created = True
+ if self.pid == 0:
+ # Child
+ try:
+ # Close parent's pipe ends
+ if p2cwrite is not None:
+ os.close(p2cwrite)
+ if c2pread is not None:
+ os.close(c2pread)
+ if errread is not None:
+ os.close(errread)
+ os.close(errpipe_read)
+
+ # Dup fds for child
+ if p2cread is not None:
+ os.dup2(p2cread, 0)
+ if c2pwrite is not None:
+ os.dup2(c2pwrite, 1)
+ if errwrite is not None:
+ os.dup2(errwrite, 2)
+
+ # Close pipe fds. Make sure we don't close the same
+ # fd more than once, or standard fds.
+ if p2cread is not None and p2cread not in (0,):
+ os.close(p2cread)
+ if c2pwrite is not None and c2pwrite not in (p2cread, 1):
+ os.close(c2pwrite)
+ if errwrite is not None and errwrite not in (p2cread, c2pwrite, 2):
+ os.close(errwrite)
+
+ # Close all other fds, if asked for
+ if close_fds:
+ self._close_fds(but=errpipe_write)
+
+ if cwd is not None:
+ os.chdir(cwd)
+
+ if preexec_fn:
+ preexec_fn()
+
+ if env is None:
+ os.execvp(executable, args)
+ else:
+ os.execvpe(executable, args, env)
+
+ except:
+ exc_type, exc_value, tb = sys.exc_info()
+ # Save the traceback and attach it to the exception object
+ exc_lines = traceback.format_exception(exc_type,
+ exc_value,
+ tb)
+ exc_value.child_traceback = ''.join(exc_lines)
+ os.write(errpipe_write, pickle.dumps(exc_value))
+
+ # This exitcode won't be reported to applications, so it
+ # really doesn't matter what we return.
+ os._exit(255)
+
+ # Parent
+ if gc_was_enabled:
+ gc.enable()
+ os.close(errpipe_write)
+ if p2cread is not None and p2cwrite is not None:
+ os.close(p2cread)
+ if c2pwrite is not None and c2pread is not None:
+ os.close(c2pwrite)
+ if errwrite is not None and errread is not None:
+ os.close(errwrite)
+
+ # Wait for exec to fail or succeed; possibly raising exception
+ data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB
+ os.close(errpipe_read)
+ if data != "":
+ os.waitpid(self.pid, 0)
+ child_exception = pickle.loads(data)
+ raise child_exception
+
+
+ def _handle_exitstatus(self, sts):
+ if os.WIFSIGNALED(sts):
+ self.returncode = -os.WTERMSIG(sts)
+ elif os.WIFEXITED(sts):
+ self.returncode = os.WEXITSTATUS(sts)
+ else:
+ # Should never happen
+ raise RuntimeError("Unknown child exit status!")
+
+
+ def _internal_poll(self, _deadstate=None):
+ """Check if child process has terminated. Returns returncode
+ attribute."""
+ if self.returncode is None:
+ try:
+ pid, sts = os.waitpid(self.pid, os.WNOHANG)
+ if pid == self.pid:
+ self._handle_exitstatus(sts)
+ except os.error:
+ if _deadstate is not None:
+ self.returncode = _deadstate
+ return self.returncode
+
+
+ def wait(self):
+ """Wait for child process to terminate. Returns returncode
+ attribute."""
+ if self.returncode is None:
+ pid, sts = os.waitpid(self.pid, 0)
+ self._handle_exitstatus(sts)
+ return self.returncode
+
+
+ def _communicate(self, input):
+ read_set = []
+ write_set = []
+ stdout = None # Return
+ stderr = None # Return
+
+ if self.stdin:
+ # Flush stdio buffer. This might block, if the user has
+ # been writing to .stdin in an uncontrolled fashion.
+ self.stdin.flush()
+ if input:
+ write_set.append(self.stdin)
+ else:
+ self.stdin.close()
+ if self.stdout:
+ read_set.append(self.stdout)
+ stdout = []
+ if self.stderr:
+ read_set.append(self.stderr)
+ stderr = []
+
+ input_offset = 0
+ while read_set or write_set:
+ try:
+ rlist, wlist, xlist = select.select(read_set, write_set, [])
+ except select.error, e:
+ if e.args[0] == errno.EINTR:
+ continue
+ raise
+
+ if self.stdin in wlist:
+ # When select has indicated that the file is writable,
+ # we can write up to PIPE_BUF bytes without risk
+ # blocking. POSIX defines PIPE_BUF >= 512
+ chunk = input[input_offset : input_offset + 512]
+ bytes_written = os.write(self.stdin.fileno(), chunk)
+ input_offset += bytes_written
+ if input_offset >= len(input):
+ self.stdin.close()
+ write_set.remove(self.stdin)
+
+ if self.stdout in rlist:
+ data = os.read(self.stdout.fileno(), 1024)
+ if data == "":
+ self.stdout.close()
+ read_set.remove(self.stdout)
+ stdout.append(data)
+
+ if self.stderr in rlist:
+ data = os.read(self.stderr.fileno(), 1024)
+ if data == "":
+ self.stderr.close()
+ read_set.remove(self.stderr)
+ stderr.append(data)
+
+ # All data exchanged. Translate lists into strings.
+ if stdout is not None:
+ stdout = ''.join(stdout)
+ if stderr is not None:
+ stderr = ''.join(stderr)
+
+ # Translate newlines, if requested. We cannot let the file
+ # object do the translation: It is based on stdio, which is
+ # impossible to combine with select (unless forcing no
+ # buffering).
+ if self.universal_newlines and hasattr(file, 'newlines'):
+ if stdout:
+ stdout = self._translate_newlines(stdout)
+ if stderr:
+ stderr = self._translate_newlines(stderr)
+
+ self.wait()
+ return (stdout, stderr)
+
+ def send_signal(self, sig):
+ """Send a signal to the process
+ """
+ os.kill(self.pid, sig)
+
+ def terminate(self):
+ """Terminate the process with SIGTERM
+ """
+ self.send_signal(signal.SIGTERM)
+
+ def kill(self):
+ """Kill the process with SIGKILL
+ """
+ self.send_signal(signal.SIGKILL)
+
+
+def _demo_posix():
+ #
+ # Example 1: Simple redirection: Get process list
+ #
+ plist = Popen(["ps"], stdout=PIPE).communicate()[0]
+ print "Process list:"
+ print plist
+
+ #
+ # Example 2: Change uid before executing child
+ #
+ if os.getuid() == 0:
+ p = Popen(["id"], preexec_fn=lambda: os.setuid(100))
+ p.wait()
+
+ #
+ # Example 3: Connecting several subprocesses
+ #
+ print "Looking for 'hda'..."
+ p1 = Popen(["dmesg"], stdout=PIPE)
+ p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
+ print repr(p2.communicate()[0])
+
+ #
+ # Example 4: Catch execution error
+ #
+ print
+ print "Trying a weird file..."
+ try:
+ print Popen(["/this/path/does/not/exist"]).communicate()
+ except OSError, e:
+ if e.errno == errno.ENOENT:
+ print "The file didn't exist. I thought so..."
+ print "Child traceback:"
+ print e.child_traceback
+ else:
+ print "Error", e.errno
+ else:
+ print >>sys.stderr, "Gosh. No error."
+
+
+def _demo_windows():
+ #
+ # Example 1: Connecting several subprocesses
+ #
+ print "Looking for 'PROMPT' in set output..."
+ p1 = Popen("set", stdout=PIPE, shell=True)
+ p2 = Popen('find "PROMPT"', stdin=p1.stdout, stdout=PIPE)
+ print repr(p2.communicate()[0])
+
+ #
+ # Example 2: Simple execution of program
+ #
+ print "Executing calc..."
+ p = Popen("calc")
+ p.wait()
+
+
+if __name__ == "__main__":
+ if mswindows:
+ _demo_windows()
+ else:
+ _demo_posix()
15 years
cas-admin
by Adam Stokes
cas-admin | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 39a1e594728e68ef57a670318228c71db6d5a125
Author: adam stokes <ajs(a)redhat.com>
Date: Tue May 5 14:27:54 2009 -0400
- finalizing purge/autopurge code. bugfixes to come.
diff --git a/cas-admin b/cas-admin
index 456390e..1d11447 100755
--- a/cas-admin
+++ b/cas-admin
@@ -202,6 +202,11 @@ class CasAdminApplication(object):
os.makedirs(os.path.dirname(DATABASE))
if not os.path.isdir(DEBUGS):
os.makedirs(DEBUGS)
+
+ # if autopurge is enabled lets clean up some stale data
+ if AUTOPURGE:
+ self.casLog.debug('Autopurge enabled, begin cleanup')
+ purgeHandler = PurgeHandler(int(PURGELIMIT), self.casLog).run()
if self.purgeData:
ans = raw_input("You are about to purge data, is this what you " \
15 years
cas-admin
by Adam Stokes
cas-admin | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 95873f13f998893087555b5c0ea7ac731eebbd15
Author: adam stokes <ajs(a)redhat.com>
Date: Tue May 5 13:51:41 2009 -0400
purge code in alpha stage, initial testing proves positive
diff --git a/cas-admin b/cas-admin
index 3625e47..456390e 100755
--- a/cas-admin
+++ b/cas-admin
@@ -157,14 +157,14 @@ class PurgeHandler(object):
dirpath = os.path.join(root,d)
# pull out date from directory structure and trim it to
# (year, month, day)
- searchDate = util.regexSearch('(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)', dirpath)
+ searchDate = self.util.regexSearch('(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)', dirpath)
if searchDate:
self.casLog.debug('found %s' % (searchDate,))
(year, month, day) = searchDate.split('.')[:3]
# create our datetime object so we can do some arithmetic
dirDate = datetime.date(int(year), int(month), int(day))
self.casLog.debug(dirDate)
- if cutOffDate < dirDate:
+ if dirDate < cutOffDate:
self.casLog.debug('Should purge old directories, %s' % (dirpath,))
rmtree(dirpath)
15 years
cas-admin
by Adam Stokes
cas-admin | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
New commits:
commit d1a0d1c3acd3bc36d6bdc9553704cbd413952e0b
Author: adam stokes <ajs(a)redhat.com>
Date: Tue May 5 13:44:50 2009 -0400
debug datetime
diff --git a/cas-admin b/cas-admin
index d4b197b..3625e47 100755
--- a/cas-admin
+++ b/cas-admin
@@ -144,12 +144,13 @@ class PurgeHandler(object):
def __init__(self, purgeDays, logger):
self.purgeDataDays = purgeDays
self.casLog = logger
- self.util = UtilBase
+ self.util = UtilBase()
self.todaysDate = datetime.date.today()
def run(self):
# create date of timedelta
- cutOffDate = self.todaysDate - self.purgeDataDays
+ cutOffDate = self.todaysDate - datetime.timedelta(days=self.purgeDataDays)
+ self.casLog.debug(cutOffDate)
# Start of purging data
for root, dirs, files in os.walk(WORKDIRECTORY):
for d in dirs:
@@ -158,10 +159,13 @@ class PurgeHandler(object):
# (year, month, day)
searchDate = util.regexSearch('(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)', dirpath)
if searchDate:
+ self.casLog.debug('found %s' % (searchDate,))
(year, month, day) = searchDate.split('.')[:3]
# create our datetime object so we can do some arithmetic
dirDate = datetime.date(int(year), int(month), int(day))
+ self.casLog.debug(dirDate)
if cutOffDate < dirDate:
+ self.casLog.debug('Should purge old directories, %s' % (dirpath,))
rmtree(dirpath)
class CasAdminApplication(object):
@@ -205,10 +209,11 @@ class CasAdminApplication(object):
if ans=='Y' or ans=='y':
if not self.purgeDataDays:
self.purgeDataDays = PURGELIMIT
- self.casLog.info("Beginning Purge going back %s days" % (self.purgeDataDays,))
- purgeHandler = PurgeHandler(self.purgeDataDays, self.casLog).run()
+ self.casLog.info("Beginning Purge going back %s day(s)" % (self.purgeDataDays,))
+ purgeHandler = PurgeHandler(int(self.purgeDataDays), self.casLog).run()
+ raise SystemExit(self.casLog.info("Purge finished"))
else:
- raise SystemExit("Purge canceled.")
+ raise SystemExit(self.casLog.info("Purge cancelled"))
if self.buildDB:
self.casLog.info("Starting CAS DB instance.")
15 years