Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have created a window service and set some dependencies like on MSMQ, MSSQLSERVER and so. Everything is working nice. but i need to send another dependency for my service. That is on internet connection. My service is responsible for sending emails. As soon my server starts, my service starts too and it finds if there is anything to send, if there is, it starts to send email, if during sending it is not able to connect to the internet it cannot send email.

so i guess i should set my service dependency on internet connection too. I already set my window service dependency to MicrosoftSQL Server and Microsoft Message Queuing by editing the registry value.

by adding new multi string value named "DependOnService", Type "REG_MULTI_SZ" and space separated names of the services that my service depends upon for the Data.

For Microsoft SQL Server i set the value to "MSSQLSERVER" but i don't know the name of the internet service that i need to set dependency upon.

how can i do this, any help please Thanks

share|improve this question

migrated from stackoverflow.com Apr 27 '10 at 2:26

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

This shouldn't have been migrated because the solution is programmatic. Have your service test the Internet connectivity before trying to send the messages. If there's no connection (e.g. ping an IP address that can be relied on to be there, such as your ISP's gateway), sleep for a bit and try again.

share|improve this answer
add comment

I'm having this same issue with a windows service where the service expects to listen on an IP address that hadn't been readied yet. I added a dependency to Netman (Network Connections) and also to SQL Server (which the service also depends on). Rather than muck with the registry, I used the command line, as such:

sc \\YOURSERVERNAME config YOURSERVICENAME depend= NETMAN/MSSQLSERVER

Be sure to replace your server name and your service name. If successful, you should see:

[SC] ChangeServiceConfig SUCCESS

I'm waiting to confirm this works until the next weekly reboot, but it should!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.