Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7559147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:33:47+00:00 2026-05-30T12:33:47+00:00

I am writing a service that basically is responsible for turning on and off

  • 0

I am writing a service that basically is responsible for turning on and off other services but they need to be turned on and off in a particular order.

  1. SvcMain
  2. i. SvcMasterPool1
    ii. SvcMasterPool2
    iii. SvcMasterPool3
    ……
  3. i. SvcChildPool1
    ii. SvcChildPool2
    iii. SvcChildPool3
    …..

Here are the rules:
To stop a service:

  1. If #1 is to be stopped, everything else needs to be stopped before it.
  2. If anything in #2 needs to be stopped, the matching service in #3 needs to be stopped first. (SvcChildPool1 must stop before SvcMasterPool1)
  3. Services in #3 can be stopped without any pre-conditions.

To start a service:
Its the exact opposite of the stopping sequence.
1. For the services in #3 to start, the matching svc in #2 and the #1 need to be started
2. Services in #2 need #1 to be started
3. No pre-conditions for #1


The number of Master and Child Svcs can increase or decrease over time. I don’t want to hard code the logic in my code and i was thinking about driving it using regular expressions. What I am stumped on is getting the matching svc from #3. If i know that i need to stop “SvcMasterPool2” how do i come up with “SvcChildPool2”. I can have a regex to match all the SvcChildPoolX but cannot come up with a solution to match the equivalent child.

Any help would be appreciated or any other suggestions for a more suitable approach is welcome.

I am planning on using a database but I dont want to add the sequence for individual servers. hence the idea of using RegEx. so i just store the pattern and use it across all servers.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:33:49+00:00Added an answer on May 30, 2026 at 12:33 pm

    If the services are setup properly in Windows, then they can report what depends on them.

    You can use the ServiceController to start and stop the services, and use its property DependentServices to handle starting and stopping what depends on them.

    Related question:
    Restart a service with dependent services?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service that is responsible for writing a log file. I
I am writing an Android alarm application that uses a Service in order to
I am writing a WCF service that receives notifications from several modules (DB, other
Writing a Service that is running on IIS. Basically looks like this: void ProcessRequest(HttpContext
I am writing WCF service that uses wsHttpBinding binding, which is not hosted in
I'm writing a Windows Service that needs to take a file from an FTP
I have the following data model: I am writing a WCF service that needs
I'm writing a windows service application that needs to serialize and deserialize XML documents
I'm writing JUnit tests for a service that creates and acts on an entity
I'm writing in .NET a windows service that, at windows startup, executes some network

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.