Solved

Service is not restarted automaticly

Posted on 2011-03-18
2
265 Views
Last Modified: 2012-05-11
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
Comment
Question by:Ohmit
2 Comments
 
LVL 3

Accepted Solution

by:
CombatGold1 earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:Ohmit
Comment Utility
Youre the BEST! ;-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Because virtualization becomes more and more common, and, with Microsoft Hyper-V included in Windows Server at no additional costs, and, most server hardware nowadays is more than capable of running a physical Small Business Server (SBS) 2008 or 201…
I’m often asked about newer and larger USB drives connected to SBS2008 and 2011 failing Windows Server Backup vs the older USB drives not failing. As disk space continues to grow and drive technology change SBS2008 and some SBS2011 end up with the f…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now