Thursday, 04 March 2021 13:11

How to gracefully shutdown your SAP ABAP Platform Developer Edition when shutting down Windows

Written by Andre Fischer
Rate this item
(0 votes)
Source https://blogs.sap.com/2021/03/05/how-to-gracefully-shutdown-your-sap-abap-platform-developer-edition-when-shutting-down-windows/
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”

As announced by the blog SAP ABAP Platform 1909, Developer Edition: AVAILABLE NOW of my colleague Julie Plummer the new ABAP Platform developer edition is available as a Docker image so that you can run it on your laptop.

Running it on you laptop does also mean that you are responsible for it and that you have to make sure to shutdown the system in a proper way.

Unfortunately Docker only waits up to 10 seconds for a container to stop before it kills the process which will then result in an inconsistent HANA DB ?.

This happened to me on the very first day as a ABAP Platform developer edition user ?.

As mentioned in the setup instructions of the ABAP platform docker image in order to gracefully shutdown your docker image you should run the following command before stopping docker or shutting down your laptop.

docker stop --time 7200 a4h

So if you just shutdown your laptop (as I did) without having run the above mentioned command beforehand you have a problem …

If this happens to you, you only have to delete the container using Docker Desktop and recreate it using the following command

docker run --stop-timeout 3600 -i --name a4h -h vhcala4hci -p 3200:3200 -p 3300:3300 -p 8443:8443 -p 30213:30213 -p 50000:50000 -p 50001:50001 store/saplabs/abaptrial:1909 -skip-limits-check -agree-to-sap-license

So you fortunately don’t have to download the whole image again ?.

However all the ABAP development you have done might be lost if you haven’t saved it to some Git repository.

Reading through the setup instructions I was wondering whether there is a way to run the command as a script automatically when shutting down Windows because I know myself and I was sure that I would otherwise run into this problem again and again.

As described in this answer posted on Stackoverflow it is possible to do the following:

  1. Run gpedit.msc to open the Group Policy Editor
  2. Navigate to Computer Configuration | Windows Settings | Scripts (Startup/Shutdown).
  3. Double click on Shutdown

Local Group Policy Editor (Picture taken from above mentioned answer in Stackoverflow)

This will open a dialogue to select a script from a location of your choice. The default location (administrative access is needed) is the following folder

C:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown

Here I have created the script stop_docker.cmd

The source code of this script is shown here

set MyDir="C:\temp" IF not 
Continue reading here
Read 178 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.