0

I've written a windows service thats part of software, I deployed the service on both windows server 2003 and 2008, the client contacted me complaining that when they restarted their servers they kept restarting and this happened on the two machines with two different clients,restarting the servers with last good configuration worked, and the servers are up, I connected to one of the server and ran process monitor, I enabled boot logging then installed my service again , the problem appeared again, booting the system with last good configuration worked, looking at the boot log showed the service works properly and nothing is strange, I decided to install a virtual machine and try to repeat the action, when I did so I found that the virtual machine, reaches the login manager then after a few seconds it restarts, it keeps doing so until I boot the machine in last good configuration, there is no chance to login and run process monitor, any suggestion how to track this problem? any of the sysinternals tools could help?

Thanks in advance,

Ahmad J. Hamad
  • 121
  • 2
  • 12

1 Answers1

0

Others might be able to suggest some good tools but if all fails what you can do is write a function within your service that appends a string parameter to some text file and then call that function with an incrementing number after every (or every nth) line of tge service startup code. Then repeat your tests. After the reboot, check the file and it will precisely tell you what line caused the computer to restart. You can check the code to find the reason or post the offending code here and people may be able to help you better.

devsh
  • 21
  • 1
  • yes, I understand what you're saying, but my service exits sucessfully and the boot process continues, my service tries to connect to some socket server at startup and it fails, and based on that it cleans up and exits and I can see all that happens. so no doubts about the service. – Ahmad J. Hamad Jun 27 '11 at 19:43
  • Without looking at the boot log or the code, it's hard to tell, but here are other things you can try: 1) go to the properties of the service and make sure it is not setup to restart computer on first failure 2) check the boot log with your service disabled and then with service enabled for any differences 3) change the service to "manual" start from auto-start and then try starting it manually after computer has booted up to see if there are any clues in terms of error message or log 4) If all fails, you can comment majority of code and then incrementally uncomment code till the problem occur – devsh Jun 27 '11 at 19:49
  • Thanks devsh, yes I got this, but as I said I ran process monitor, my service runs and tries to connect to a socket server then exits successfully, there is nothing related to the service code that makes the servers restart, I kept tracking actions in process monitor but nothing appears to be unusuall, the login of windows appears for a few second then it restarts there is no chance to log and run process monitor, but what I'm looking for is a way to attach something like process monitor remotely for a few seconds, however, if there is something faulting, it should appear in the event viewer – Ahmad J. Hamad Jun 28 '11 at 09:46