Re: Process.Start() in windows service on Windows Server 2003, problem
From: Pavel Lebedinsky (m_pll)
Date: 02/24/05
- Next message: Rhett Gong [MSFT]: "RE: Scheduled tasks on remote machines"
- Previous message: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- In reply to: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Next in thread: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Reply: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 23 Feb 2005 22:13:55 -0800
I have lots of other ideas :)
For example, does it work if you remove stdout redirection
from the picture?
Do you see process start/exit events for ExtExp.exe if you
enable "Audit process tracking" in the Local Security Policy?
You will need to run gpupdate after you change this setting.
The events should be logged in the security event log with
the category name of "Detailed tracking".
What happens if you do this:
ren ExtExp.exe ExtExp.exe.old
copy %windir%\system32\ipconfig.exe .\ExtExp.exe
then run your code again? Do you get output from ipconfig.exe?
What happens if you run ExtExp.exe under debugger?
Change your Process.Start call to use these settings:
executable name: ntsd.exe
parameters: -server tcp:port=12345 <full path to ExtExp.exe> <ExtExp
parameters>
When you call Process.Start with these settings you
should see ntsd.exe and ExtExp.exe appear in Task Manager.
ExtExp will be suspended in debugger. You can then attach
to it like this:
ntsd -remote tcp:server=localhost,port=12345
Once you've attached to the remote session hit 'g' and see
hat happens.
"Tobias Johansson" wrote:
> Thank you for your reply,
>
> I have tried both your suggestions,
> but a can't get it to interact with the desktop. (no cmd window starts)
> The cmd starts but not ExtExp.exe (monitored in task manager)
>
> And I get no exceptions running it in remote debug mode.
>
> I also made the extexp write to a log file the first thing it does..
> nothing is in the log file after a run attempt .. wich means the program
> never actually runs.
>
> If you have any other ideas, they are greatly appreciated.
>
> Thank you once again for your time.
>
>
> "Pavel Lebedinsky" <m_pll at hotmail com> skrev i meddelandet
> news:ujZs6GXGFHA.3732@tk2msftngp13.phx.gbl...
>> So it looks like the process starts successfully but then terminates
>> for some reason. May be it doesn't like the service environment
>> or something like that.
>>
>> You could try configuring the service to run as System and enabling
>> the "allow to interact with desktop" checkbox. Then you should be
>> able to see your process window while it's running. If it goes away
>> too quickly change the command line to something like
>> "cmd /k test.cmd" and put the actual command in the test.cmd file.
>>
>> Another option is to run your process under the built in debugger
>> (ntsd.exe) to see if you're getting any exceptions. You'll need to use
>> the -server and -remote options to connect to the debugger session
>> (unless you change your service to be interactive as described above).
>>
>> "Tobias Johansson" wrote:
>>
>>> I tested with notepad before and it worked,
>>> but I can't actually see it because the program is running as a windows
>>> service.
>>>
>>> However I tried it again today with the same result.
>>> I also tried with ipconfig.exe and it worked without problem
>>> and I got the output of my ip configuration in my log file.
>>>
>>> I also corrected the deadlock issue,
>>> to read the stream before exit. Thanks pointing that out.
>>>
>>> I know win 2003 server has extra security on running exe files mapped on
>>> network drives
>>> but this is not on a mapped drive, it's local.
>>> But coul'd it be related ? but then console program wouldn't have worked
>>> either...?
>>>
>>> I have also tried setting the current work dir of the service to the
>>> work dir where the exe is
>>> before executing it .. no change..
>>>
>>> I have also checked the permissions on the file
>>> and that the user that the service runs as has access to it (currently
>>> as local admin just to make it work)
- Next message: Rhett Gong [MSFT]: "RE: Scheduled tasks on remote machines"
- Previous message: Rhett Gong [MSFT]: "RE: Decryption using private key from cert store failing with err"
- In reply to: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Next in thread: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Reply: Tobias Johansson: "Re: Process.Start() in windows service on Windows Server 2003, problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|