cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Start/Stop SAP with systemd script - Linux 7 (RHEL7)

0 Kudos
7,093

Hi,

I'm trying to create a systemd service script on RHEL7 to shutdown/startup the SAP app automatically if the server gets rebooted. I saw already some forums that talk about it, but didn't find a solution that works for my script.

Below, is the systemd service script that I'm using and it works for the startup of the SAP app, but not for the shutdown... As soon as I try to reboot the server, all the services are killed immediately without running the "ExecStop" command on the script.


Could you give me some light on how to solve this issue?

[Unit]
Description=SAP.service
After=local-fs.target network.target network-online.target

[Service]
Type=simple
RemainAfterExit=true
Environment="SID1=SID" "DAA=DAA"
KillMode=none
SendSIGKILL=no
ExecStart=/usr/bin/python /usr/sap/scripts/SAPstart.py
ExecStop=/usr/bin/python /usr/sap/scripts/SAPstop.py
TimeoutSec=60

[Install]
WantedBy=multi-user.target


Thanks in advance,

Carlos

View Entire Topic
moti_shakutai
Explorer
0 Kudos

Hi Carlos,

facing the same problem !!

Did you overcome ? if yes then how

Thanks

Moti