Error: pgsql\bin\pg_ctl.exe does not exist or is being used by another program

Error: pgsql\bin\pg_ctl.exe does not exist or is being used by another program

Issue description

When starting ADManager Plus, the application fails to launch and displays an error indicating that pg_ctl.exe is missing or in use. This prevents the internal PostgreSQL database from starting, resulting in a complete startup failure of the product. 

Possible causes 

  1. Executable missing or quarantined: pg_ctl.exe may have been removed or isolated by antivirus software or deleted accidentally.

  2. File in use: Another process (e.g., postgres.exe, wrapper.exe, or java.exe) may be locking the file.

  3. Port conflict: The default PostgreSQL port (33306) may be in use by another application.

  4. Antivirus/endpoint security interference: Security tools may block access to PostgreSQL components.

  5. Permission issues: The ADManager Plus service account may lack the required permissions to access the installation directory.

Prerequisites 

  • Administrator privileges on the machine

  • Access to antivirus or endpoint protection settings

  • Knowledge of the ADManager Plus installation path

  • Ability to identify and terminate background processes using Task Manager

Resolution 

Step 1: Terminate conflicting processes 

  1. Open the Command Prompt and navigate to the ADManager Plus \bin directory.
    Example: cd C:\ManageEngine\ADManager Plus\bin

  2. Run the following commands to stop database-related services:

    • stopDB.bat

    • stopADSM.bat

  3. Open Task Manager and go to the Details tab and add the Image Path Name column.

  4. End any processes from the ADManager Plus installation folder, such as:

    • wrapper.exe

    • postgres.exe

    • java.exe

 Step 2: Check for port conflicts 

  1. Open the Command Prompt as an admin and run:

    Info
    netstat -aon | findstr :33306

  2. Note the PID using the port.

  3. Locate the process in Task Manager and terminate it if it’s unrelated to ADManager Plus.

 Step 3: Add antivirus exclusions

 Add these paths to your antivirus or endpoint protection exclusion list:

  • \ADManager Plus\pgsql

  • \ADManager Plus\bin

  • \ADManager Plus\server

Restart both the antivirus software and the server after applying exclusions.

 Step 4: Check and fix folder permissions 

  1. Open Services.msc, locate ManageEngine ADManager Plus, and go to Properties > Log On.

  2. Ensure the configured service account has Full Control over the ADManager Plus directory.

  3. If running under the Local System Account, ensure your logged-in user also has Full Control on the installation folder.

 Step 5: Start ADManager Plus

  1. In Services.msc, right-click ManageEngine ADManager Plus.
  2. Click Start to restart the application.

Tips 

  • Always verify antivirus interference by temporarily disabling or switching to silent mode.

  • Schedule PostgreSQL exclusions before upgrades to avoid false-positive quarantines.

  • Please reach out to support if pg_ctl.exe is permanently missing and cannot be restored.

How to reach support

If the issue persists, contact our support team here.

                  New to ADSelfService Plus?