Windows Service Starts Up All By Its self

H

hitesh.ladva

Hi,

I have a windows service that is marked as aurtomatic, when I go to the
service manager console and stop the service the service the reports
that it has stopped (event log), afte about 2-5 mins later the service
starts up without anyone requesting it to start.

There are no dependicies for this service, the service is not called
form any external source.

This is driving me crazy, please can anyone suggest how i can resolve
this / debug this issue.

Is there a way of monitoring what processes start up and geing the
processes loged to a file for later analysis?

Thank you for your assistance in this matter.
 
P

Pegasus \(MVP\)

Hi,

I have a windows service that is marked as aurtomatic, when I go to the
service manager console and stop the service the service the reports
that it has stopped (event log), afte about 2-5 mins later the service
starts up without anyone requesting it to start.

There are no dependicies for this service, the service is not called
form any external source.

This is driving me crazy, please can anyone suggest how i can resolve
this / debug this issue.

Is there a way of monitoring what processes start up and geing the
processes loged to a file for later analysis?

Thank you for your assistance in this matter.

Disable the service if you do not want it to run.
 
H

hitesh.ladva

Yes, I know that , my question is why does the service start up after a
user has requested it stopped?

Also we have script that switches the service off in the evening and
restarts it in the morning (Batch processing period)

Also, I have ensured that the recovery options are set to do nothing
for the service.
 
P

Pegasus \(MVP\)

Yes, I know that , my question is why does the service start up after a
user has requested it stopped?

Also we have script that switches the service off in the evening and
restarts it in the morning (Batch processing period)

Also, I have ensured that the recovery options are set to do nothing
for the service.

As you have found out, anything can start or stop a
service, e.g. your script, without being listed in the
dependencies list. Take the Removable Storage Service,
for example. It shows no dependencies yet it will start
and stop regularly when ntbackup runs. You may be
able to identify the starting agent by analysing in detail
what the service does and which applications might
make use of it.

You can find out when the service started by replacing
its ImagePath in the registry with your own command
like so:
%SystemRoot%\system32\cmd.exe /c c:\test.bat

Test.bat should contain these lines:
@echo off
echo Service started on %date% at %time% >> c:\test.log
%SystemRoot%\system32\svchost.exe -k netsvcs

Line 3 is the ImagePath line shown in the registry.

Get your script to disable the service in the evening and
enable it in the morning. If something fails then you will
know what attempted to start the service.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top