staf cmd return RC=1 when staf run as service

  • xiaoqin

    xiaoqin - 2012-12-04

    we run staf as services on our testbed, then met below issue. But if run staf not as service, not occur below issue.

    dataview_path = 'c:/Program Files (x86)/Reuters/DataView/DataView.exe'
    cmd_parms = '/TRWF2 /IM /PM 22222 /IH /L 260 /R F.N /REF /IFMS /PFMS 25000 /FEED SI3 /D MARKET_PRICE'
    req_str = 'START COMMAND %s PAMRS %s' % (STAFUtil.wrapData(dataview_path), STAFUtil.wrapData(cmd_parms))
    handle.submit2(IP, "process", req_str)

    when we run req_str this command, return RC=1 error, but if we start staf not as service, the command can execute sucessfully.
    Because this command related to soap msg, and i don't think whether there are some connection with this??

    thanks in advance.

  • Sharon Lucas

    Sharon Lucas - 2012-12-04

    When configuring STAFProc to run as a service did you follow the instructions in section "11. Starting STAFProc during system reboot", sub-section "11.3 Windows" in the STAF Installation Guide at, particularly step 10:

    10. From the 'Log On' tab, click 'Allow service to interact with desktop', then click on Apply and then click on OK.

    This could account for the difference in behavior.

    What version of Windows are you using where this problem occurs?  Note that Windows 2008 (and later) no longer supports services inteacting with the user desktop for security reasons.  See

  • xiaoqin

    xiaoqin - 2012-12-04

    we use windows 2008, is there any other method to solve this problem, and we need staf run as service.

  • xiaoqin

    xiaoqin - 2012-12-04

    sorry, windows server 2008. you mean for windows server 2008, we should manually click "allow service to interact with desktop"?

  • Sharon Lucas

    Sharon Lucas - 2012-12-07

    I don't know if your "DataView.exe" executable requires interaction with the desktop.  If it does, then it may not be possible to run it with STAFProc configured to run as a service due to the limitation in Windows that is talked about in the link I gave.  You could try configuring STAFProc with and without the "Allow service to interact with desktop" selected and see if it works.  Otherwise, you may have to ask Microsoft this question.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks