Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Have you ever wondered why stopping the sapstartsrv service (sapstartsrv.exe) in Windows environment brings the application down as well !

In UNIX/LINUX environment this is not the case , you stop/restart the sapstartsrv service it will have not bring the application server crashing down 😉


I was working on my test system and I had to test some conditions for which I had to terminate the sapstartsrv service and restart it. I am used to Linux env where we manually call the sapcontrol -nr XX -function StopService SID to stop the sapstartsrv.

This time I was working on my winodws test so as usual practice I wen to services.msc , found out my sapstartsrv.exe  ( SAPSID_XX ) and stopped it. Then I began my other task which I was performing  and suddenly I got an alert/popup saying my user had been logged out due to "connection to partner broken ".

Oh boy! I had made a blunder 😐


Play it safe!

Now the question I came across this time was why is this behavior?

So I quickly logged onto my other test system which runs on RHEL 7 and tried the command :

sapcontrol -nr XX -function StopService SID

I got the result "StopService" OK

I wanted to confirm the status of my application instance, so I quickly ran the command :

sapcontrol -nr XX -function GetProcessList

Bingo! All the process were green!

(Again I started the sapstartsrv manually.)

So what was wrong with Windows ?

Understanding the behavior

I did some research on how the sapstart and sapstartsrv is called in both the OS environments.
Believe me there is a difference 😐

In unix/linux OS the instance is started by the "process" sapstartsrv and not the "service" sapstart.

The sapstart -service controls the start/stop of the application instance components ( dispatcher + icm + gateway+igs).So when you stop the sapstartsrv it will ot affect the system start/stop. As sapstartsrv would ask  "sapstart" to start child processes, (more information in startsap.trc)

Okay! Agreed , but what's up with Windows?

Here comes the answer!!
In windows the instance is started directly by the start service (process sapstartsrv.exe). On Windows a "service" is a process ,sapstartsrv is such a user defined service . When you stop the sapstartsrv.exe it will bring down your instance as well 😞


There is a very nice document explaining this behavior : SAP Start Service

What next ?

Next time before restarting the sapstartsrv.exe is windows be careful ! that's IT



Manjunath Hanmantgad