Note that I've seen trying to run a shell script on a Linux machine fail 
if it doesn't have the right permissions (e.g. execute permissions).  For 
example:

C:\>staf linux1 process start shell command "/usr/local/staf/testit.sh" 
returnstdout stderrtostdout wait
Response
--------
{
  Return Code: 126
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: line 1: /usr/local/staf/testit.sh: Permission 
denied

    }
  ]
}

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 838-8347 or Tieline 678-8347

----- Forwarded by Sharon Lucas/Austin/IBM on 11/11/2008 02:49 PM -----

Sharon Lucas/Austin/[EMAIL PROTECTED] 
11/11/2008 02:25 PM

To
Marji Berkman/Westford/IBM <[EMAIL PROTECTED]>
cc
staf-users@lists.sourceforge.net
Subject
Re: [staf-users] staf CRON fails with RC 126







Please modify your registration request by adding options "RETURNSTDOUT 
STDERRTOSTDOUT WAIT" to your PROCESS START request to get more information 
on invoking your shell script is returning return code 126 and retry and 
let us know the results.  For example: 

register machine local service process request "start shell command 
/usr/local/stax/prod/customLibrary/crons/CheckForLatestBuild.sh 
returnstdout stderrtostdout wait" hour any

Note that adding the WAIT option will prevent the RC 11 error (which can 
occur if the command completes immediately before the CRON service has a 
chance to be notified when it completes).   

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 838-8347 or Tieline 678-8347



Marji Berkman/Westford/IBM <[EMAIL PROTECTED]> 
11/11/2008 01:12 PM 


To
staf-users@lists.sourceforge.net 
cc

Subject
[staf-users] staf CRON fails with RC 126








Any help would be greatly appreciated! 

This cron triggers a simple shell script on the local linux machine.   
It sets a few variables after searching some files. 
It runs fine when run from the command prompt, and was getting ok results 
when run by the cron. 
I believe it started having problems when the machine was rebooted, but 
cannot vouch for that. 
I have another cron which is running fine on the same machine (runs daily 
at 2 am, which executes stax commands). 


The first error code below is: a staf rc of 11 which means: 
           Process Already Complete         You are trying to perform an 
invalid operation on a process that has already completed. For example, 
you may be trying to stop the process or register for a process end 
notification. 
The second is 126:   I suspect an OS return code. 

Here's the command to register it: 
staf local cron register machine local service process request "start 
shell command 
/usr/local/stax/prod/customLibrary/crons/CheckForLatestBuild.sh" hour any 


Here's the log after  it runs once on schedule and after being triggered 
via staf local cron trigger id 35: 
Date-Time         Level Message 
----------------- ----- 
------------------------------------------------------- 
20081111-13:54:09 Info  [ID=35] [local://local, STAF/Client] Registered a 
STAF 
                       command. Register request: register machine local 
servi 
                       ce process request :83:start shell command 
/usr/local/s 
                       tax/prod/customLibrary/crons/CheckForLatestBuild.sh 
hou 
                       r any 
20081111-14:00:06 Info  [ID=35] [domino-la.notesdev.ibm.com:111917] 
Submitted a 
                        STAF command. Triggers: hour[14] Submitted STAF 
comman 
                       d: STAF local process start shell command 
/usr/local/st 
                       ax/prod/customLibrary/crons/CheckForLatestBuild.sh 
20081111-14:00:06 Pass  [ID=35] [domino-la.notesdev.ibm.com:111917] 
Completed a 
                        STAF command. RC=0, Result=3089 
20081111-14:00:06 Error [ID=35] [local://local:111917] Process completion 
notif 
                       ication to  machine local://localfailed for handle 
3089 
                        RC=11 Result= 
20081111-14:07:50 Info  [ID=35] [local://local, STAF/Client] Triggering a 
STAF 
                       command. trigger id 35 
20081111-14:07:50 Info  [ID=35] [domino-la.notesdev.ibm.com:112734] 
Submitted a 
                        STAF command. Triggered manually Submitted STAF 
comman 
                       d: STAF local process start shell command 
/usr/local/st 
                       ax/prod/customLibrary/crons/CheckForLatestBuild.sh 
20081111-14:07:50 Pass  [ID=35] [domino-la.notesdev.ibm.com:112734] 
Completed a 
                        STAF command. RC=0, Result=3188 
20081111-14:07:51 Fail  [ID=35] [domino-la.notesdev.ibm.com:112734] 
Process com 
                       pleted. Process info: {key=, 
endTimestamp=20081111-14:0 
                       7:51, fileList=[], handle=3188, rc=126} 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________

staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to