You need to check the result's RC to see if it successfully submitted the 
PROCESS START request like the example I sent you is doing:

 STAFResultPtr res = handlePtr->submit(machine, "PROCESS", request);

 if (res->rc != kSTAFOk)
 {
     cout << "STAF " << machine << " PROCESS " << request << " failed with 
RC=" 
          << STAFString(res->rc)
          << " Result=" << res->result << endl;
     return res->rc;
 }

 cout << "Result (the STAF handle for the process): " << res->result << 
endl << endl;

 
If the process starts but then fails, then you may want to put the 
process's stdout/stderr in a file so that you can see what the process is 
doing and if it is logging an error message.  You can do this by adding 
options like " STDOUT /tmp/process.out STDERRTOSTDOUT" to the PROCESS 
START request.

You should probably first simply submit the PROCESS START request via the 
STAF command line executable (instead of via a C++ program) to make sure 
it is working.  For example:

STAF cyclvm10.rtp.netapp.com PROCESS START SHELL COMMAND 
"/u/hardikd/p4/proj/hammerChange/hammer 
/u/hardikd/p4/proj/hammerChange/logs -filercore hardikd-vsim2 -runtime 60 
-bg" STDOUT /tmp/process.out STDERRTOSTDOUT

You can see if the process is still running by querying the process's 
handle.  For example: 
  STAF cyclym10.rtp.netapp.com PROCESS QUERY HANDLE <processHandle>

Note that a PROCESS START request requires trust level 5 so be sure that 
machine cyclym10.rtp.netapp.com gives trust level 5 to the machine that is 
submitting the PROCESS START request.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   "Dedhia, Hardik" <hardik.ded...@netapp.com>
To:     <staf-users@lists.sourceforge.net>
Date:   07/07/2011 03:34 PM
Subject:        [staf-users] Regarding Process Start Command




Hi,
 
The following is my code. I wish to start a process remotely and acquire 
it’s handle so I can communicate through this handle and send messages to 
the process’ queue.
 
28          STAFString command = "/u/hardikd/p4/proj/hammerChange/hammer 
/u/hardikd/p4/proj/hammerChange/logs -filercore hardikd-vsim2 -runtime 60 
-bg";
 29         STAFString request = "START SHELL COMMAND " + 
STAFHandle::wrapData(command);
 30         cout << request << endl;
 31         STAFResultPtr result_hammer_start = 
handle->submit("cyclvm10.rtp.netapp.com", "PROCESS", request);
 32         STAFString hammer_handle = result_hammer_start->result;
 
It doesn’t seem to launch the Process :: the process doesn’t show up when 
I do >>ps ux.
 
Thanks,
 
Hardik.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


<<image/gif>>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to