Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a "delay" service?

42 views
Skip to first unread message

John Doe

unread,
Jun 15, 2005, 3:09:05 AM6/15/05
to
I want to delay a service starting by creating a service that pauses for a
few seconds and making the other dependent on it. Anyone know how?

For those who need more info ...

Obviously when thinking about this people will point me are various articles
like:

"How to delay loading of specific services"
http://support.microsoft.com/kb/q193888/

which talks about making services dependent on other services. However this
doesn't work in my environment.

Specifically I have Exchange Server 2003 running on a server connected to a
SAN via iSCSI. The Server service is dependent on the iSCSI service, however
that dependency doesn't quite work. As soon as the iSCSI service "starts" the
next service gets the signal to start. Not good enough, as the iSCSI drives
haven't come up yet.

This can be shown with an example by creating services like the following:

service "Begin" - write a file with the time
service "Delay" - a "sleep 10" command
service "End" - write a file with the time

By making each of the created services dependent on the next one you would
expect that a file is written with a start and end time at least 10 seconds
apart. What happens is that there is little to no delay between the writes.
It would seem that the "Delay" service starts a command then signals to the
next service it can start. This makes sense as the service could be doing
anything, in this case it is just running SLEEP. As far as service control is
concerned the service is started, move on the next one.

This is similar to what happens with our iSCSI startup. The iSCSI service is
started by the drives haven't initiated. So when the Server service starts
the drives are not assigned admin shares (meaning Veritas restores don't
work!), and later when the Exch IS service starts Exchange databases don't
mount.

Any ideas on how to create a real delay service? The fundamental issue is
pausing long enough after the iSCSI service is started to allow the drives to
initiate before starting the next service.

Thanks heaps.

Pegasus (MVP)

unread,
Jun 15, 2005, 4:36:35 AM6/15/05
to

"John Doe" <Joh...@discussions.microsoft.com> wrote in message
news:407250F6-8BD3-472B...@microsoft.com...

I would try this: Instead of starting my dependent services
individually, I would mark them as "manual" start, then place
them into a batch file. This batch file might look like this:

c:\windows\system32\net.exe start iSCSI
c:\windows\system32\ping.exe localhost -n 10
c:\windows\system32\net.exe start Server
c:\windows\system32\net.exe start . . .

Don't abbreviate anything in this batch file!

To force Windows to execute your batch file rather than
the iSCSI command, modify the registry entry for the
iSCSI service and place your fully qualified batch file
name there. The location is here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\


John Doe

unread,
Jun 16, 2005, 1:12:04 AM6/16/05
to

"Pegasus (MVP)" wrote:
> I would try this: Instead of starting my dependent services
> individually, I would mark them as "manual" start, then place
> them into a batch file. This batch file might look like this:
>
> c:\windows\system32\net.exe start iSCSI
> c:\windows\system32\ping.exe localhost -n 10
> c:\windows\system32\net.exe start Server
> c:\windows\system32\net.exe start . . .
>
> Don't abbreviate anything in this batch file!
>
> To force Windows to execute your batch file rather than
> the iSCSI command, modify the registry entry for the
> iSCSI service and place your fully qualified batch file
> name there. The location is here:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
>

Thanks for the suggestion. However, making the Server service a manual
service isn't really something I wanted to do. I want everything on the
server to work as out-of-the-box except delay one service.

Any other ideas?

0 new messages