• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Service is not restarted automaticly

I have a costumer with a SBS2003 running a LOB application.

At least 2-3 times a day the service stops!
The recovery tab is set to RESTART SERVICE on all failures but it doesn't.
I can manually restart the service though with no problems.

I assumed it could be because of the Data Execution Prevention (DEP) but there is nothing here.

Can anyone give me a good idea?
0
Ohmit
Asked:
Ohmit
1 Solution
 
CombatGold1Commented:
The service could be stopping itself gracefully. A graceful stop is not a failure, which is why the service manager won't restart it automatically. It is worth checking any logs that the application produces to check if this is the case.

FireDaemon is an excellent utility for extensive services management, which offers the feature to restart a service even if it closes down gracefully.

It's not free though, so you may wish to use a batch file to keep your service alive. First of all use the SC command as follows to retrieve service details. I'm going to use service name LOB for this example.
sc qc LOB

Open in new window

You should get a reply similar to this:
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: LOB
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Program Files\LOB\lob.exe -parameter value -param2
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : LOB
        SERVICE_START_NAME : LocalSystem
We're interested in the BINARY_PATH_NAME value there. Now create a batch file along side the service EXE file like this, but replace "C:\Program Files\LOB\lob.exe -parameter value -param2" for what the BINARY_PATH_NAME value is in your service:
@ECHO OFF
:start
C:\Program Files\LOB\lob.exe -parameter value -param2
goto start

Open in new window

Now all that is left is to change your service to use the batch file rather than the executable file directly:
sc config LOB binPath= C:\Program Files\LOB\lob.bat
sc start LOB

Open in new window

Enjoy your service running 24/7.
0
 
OhmitAuthor Commented:
Youre the BEST! ;-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now