Skip to content

Service Dependencies

Akram El Assas edited this page Feb 7, 2026 · 34 revisions

Table of Contents

  1. Introduction
  2. GUI
  3. CLI Option: --deps
  4. CLI Example
  5. PowerShell Option: --deps
  6. PowerShell Example
  7. Dependency Tree Visualization

Introduction

Servy supports optional service dependencies, allowing a service to start only after one or more other Windows services are running.
Enter each dependent service by its service name (not the display name) on a new line or separate them with semicolons (;).

This ensures that your service starts in the correct order and avoids errors if required services are not yet running.

GUI

The advanced tab provides additional configuration options such as service dependencies.

servy-config-advanced

CLI Option: --deps

The --deps command-line option lets you specify one or more Windows service dependencies when installing a service via the CLI.

  • Syntax: --deps="Service1; Service2; Service3"
  • Servy will wait for all specified services to be running before starting the main service.
  • Multiple dependencies can be separated with semicolons or listed on separate lines in the configuration file.
  • This is especially useful for applications that rely on databases, message brokers, or other background services.

CLI Example

servy-cli install `
  --name="My NodeJS Service" `
  --description="My NodeJS Server" `
  --path="C:\Program Files\nodejs\node.exe" `
  --startupDir="C:\Apps\App" `
  --params="C:\Apps\App\index.js" `
  --startupType="Automatic" `
  --deps="MongoDB; MySQL80" `

PowerShell Option: -Deps

The -Deps parameter lets you specify one or more Windows service dependencies when installing a service via PowerShell.

  • Type: string (semicolon-separated list, optional)
  • Servy will wait for all specified services to be running before starting the main service.
  • Multiple dependencies can be separated with semicolons.
  • Useful for services that rely on databases, message brokers, or other background services.

PowerShell Example

Import-Module "C:\Program Files\Servy\Servy.psm1" -Force

$installParams = @{
    Quiet        = $true
    Name         = "My NodeJS Service"
    Description  = "My NodeJS Server"
    Path         = "C:\Program Files\nodejs\node.exe"
    StartupDir   = "C:\Apps\App"
    Params       = "C:\Apps\App\index.js"
    StartupType  = "Automatic"

    Deps         = "MongoDB; MySQL80"
}

Install-ServyService @installParams


## Dependency Tree Visualization

The Dependencies tab in Servy Manager provides a visual representation of a service dependency tree retrieved from the Service Control Manager (SCM). Each dependency is displayed with its current status, where running services are shown in green and stopped services in red. The tree can be refreshed at any time using the Refresh button or by pressing **F5**.

This view is especially useful for understanding startup and shutdown order, diagnosing why a service fails to start, and quickly identifying stopped or missing dependencies that may impact service availability.

<img alt="servy-manager-dependencies" src="https://github.com/user-attachments/assets/9d69b45c-4059-4dd1-86f8-a9a5f9a35427" />


**Tip:** You can combine service dependencies with pre-launch scripts and health checks to ensure that your service starts reliably in complex environments.

Clone this wiki locally