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

systemctl reboot

kknfg
Explorer
0 Kudos
2,395

Dear Linux/SAP experts,

When ever we execute the command systemctl reboot - the first step it does is it kills all SAP processes.

Later sapinit services runs to start SAP (from /etc/init.d location).

My requirements are below and tried several options, none worked for it.

Instead of Reboot command killing the SAP processes, I needed to shutdown SAP processes using sapstop command or sapinit stop command thru a service or embedding in to an existing script. Is there any way to accomplish this?

Note: I created new services under /etc/systemd/system or /usr/lib/systemd/system_shutdown or /usr/lib/systemd/system to stop SAP before the reboot command killing the processes and none worked, reason being reboot command already killed the SAP processes before it reaching my service/script.

Any ideas or exeert's suggestions?

Helps will be greatly appreciated.

thanks and best regards,

KK

[Unit] Description=Before Shutting Down

DefaultDependencies=no

RequiresMountsFor=/usr/sap /home /sapmnt /

After=shutdown.target reboot.target network.service

[Service] KillUserProcesses=no

KillMode=none

SendSIGKILL=no

RemainAfterExit=yes

TimeoutStopSec=5min

TimeoutSec=5min

Type=oneshot

ExecStart=/usr/lib/systemd/system-shutdown/NFGsapstop

[Install]

WantedBy=shutdown.target reboot.target multi-user.target network.target

View Entire Topic
moti_shakutai
Explorer
0 Kudos

Hi Kannan,

Here is an answer from SAP support for the same issue.

BTW, it did not worked for us.

Please try and publish your results

"with system, the sapinit script (and processes started by it) are placed in user slice. Normally system allows only a 90 seconds for these processes to stop before killing them.

SUSE provides a workaround for such situation: https://www.suse.com/de-de/support/kb/doc/?id=7022671

The KBA is described in the context of HA cluster, but it can be applied in the same way for standalone systems as well. I recommend you to try it first in a test environment."

Thanks

Moti

kknfg
Explorer
0 Kudos

Dear Moti,

We have Red Hat RHEL 7 version and your solution worked for us too. The only question that I have is below

Is the solution a supported solution for RHEL7? Also I need to test this scenario thoroughly, so that no other impacts are seen.

thanks for your suggestions.

KK