cancel
Showing results for 
Search instead for 
Did you mean: 

How to create service unit for SAP RedHat 7.x

Former Member
0 Kudos

Hello,

I'm trying to write service unit for SAP. I have problems with shutdown -it don't work well, because my service unit didn't shutdown database correctly.

Do you have some experience with this?

What shoud I change?

Here is my service unit:

[Unit]

Description=SAP sluzba

After=network.target sshd.target

Wants=network.target sshd.service

[Service]

Type=simple

RemainAfterExit=true

Environment="SAPSYSTEMNAME=RH7" "HOST=cz-brn1-rh7" "HOME=/home/rh7adm" "PATH=/sapdb/clients/RH7/bin:/sapdb/programs/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/sap/RH7/SYS/exe/uc/linuxx86_64:/usr/sap/RH7/SYS/exe/run:/home/rh7adm:." "DIR_LIBRARY=/usr/sap/RH7/SYS/exe/run" "LD_LIBRARY_PATH=/usr/sap/RH7/SYS/exe/run:/usr/sap/RH7/SYS/exe/uc/linuxx86_64:/sapdb/clients/RH7/lib" "RSEC_SSFS_DATAPATH=/usr/sap/RH7/SYS/global/security/rsecssfs/data" "RSEC_SSFS_KEYPATH=/usr/sap/RH7/SYS/global/security/rsecssfs/key"

KillMode=none

SendSIGKILL=no

TimeoutStopUSec=5min

TimeoutSec=5min

TimeoutStopSec=5min

User=rh7adm

Group=sapsys

ExecStart=/usr/sap/startsap

ExecStop=/usr/sap/stopsap

[Install]

WantedBy=graphical.target

/usr/sap/stopsap :

date >> /usr/sap/stopsap.log; /usr/sap/RH7/SYS/exe/uc/linuxx86_64/stopsap >> /usr/sap/stopsap.log 2>&1; whoami >> /usr/sap/stopsap.log;

Thank you for help

Accepted Solutions (0)

Answers (1)

Answers (1)

fabian_herschel
Participant
0 Kudos

Why not using SAPs script /etc/init.d/sapinit? It could easy be intergrated into the new systemd infrastructure and has the advantage to cover all components mentioned in /usr/sap/sapservices.