Can't properly stop SAP Hana on reboot / shutdown with systemd Announcing the arrival of...
What's the purpose of writing one's academic biography in the third person?
What exactly is a "Meth" in Altered Carbon?
How widely used is the term Treppenwitz? Is it something that most Germans know?
Why do we bend a book to keep it straight?
Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?
Short Story with Cinderella as a Voo-doo Witch
How to find out what spells would be useless to a blind NPC spellcaster?
How to react to hostile behavior from a senior developer?
Can an alien society believe that their star system is the universe?
What would be the ideal power source for a cybernetic eye?
Extract all GPU name, model and GPU ram
What is the meaning of the new sigil in Game of Thrones Season 8 intro?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
Naming the result of a source block
What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?
Do I really need recursive chmod to restrict access to a folder?
What is Wonderstone and are there any references to it pre-1982?
Apollo command module space walk?
Why aren't air breathing engines used as small first stages
How to bypass password on Windows XP account?
When do you get frequent flier miles - when you buy, or when you fly?
How can I make names more distinctive without making them longer?
How discoverable are IPv6 addresses and AAAA names by potential attackers?
How does debian/ubuntu knows a package has a updated version
Can't properly stop SAP Hana on reboot / shutdown with systemd
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionsystemd timer needs to run ExecStop at shutdown/rebootsystem won't poweroff, restarts with :“Synchronizing SCSI cache”how does systemd determine service is stopped?mysql service restarted during user being connected lead to failing serviceWhy is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullyStop systemd service by sending command to screen sessionStopping systemd unit together with another. Starting worksHow to safely shutdown every running VM during Restart/Shutdown in Qubes OS 4.0 without incurring a stall/delay due to a timeout? (systemd issue)Using systemd I want my Postgresql ExecStop command to run at shutdown
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
We encountered the following problem in our company. We have multiple Red Hat Enterprise Linux Servers on which "SAP HANA S/4" is running.
We created a systemd Service to automatically start and stop the daemon so that we don't need to manually interact with the system on a reboot or shutdown.
Autostart works well, but there seems to be a problem with stopping the daemon correctly on shutdown. The daemons are running with another user (individual for each server). It seems that systemd starts to kill the user sessions before the actual service is stopped; as a result, the service won't stop properly.
Service
[Unit]
Description=saphana
After=remote-fs.target user.slice sapinit.service multi-user.target
Requires=user.slice
[Service]
KillMode=none
Type=oneshot
ExecStart=/hana/source/scripts/sapHanaControl.pl start
ExecStop=/hana/source/scripts/sapHanaControl.pl stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
The script wich is called in ExecStart and ExecStop basically executes the following command.
On Start:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Start"
On Stop:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Stop"
Shutdown log
Output of the Systemd Log shows the following:
Jun 20 16:23:05 host123 systemd[1]: Stopping Session c4 of user **userxy**.
Jun 20 16:23:05 host123sapHanaControl.pl[15003]: sudo -u **userxy** csh -c "sapcontrol -nr 00 -function Stop"
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: 20.06.2018 16:23:05
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: Stop
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
Update
I see the following processes running when the system is running normally:
[root@wsstadt325 ~]# ps -ef | grep sapstartsrv
d61adm 1740 1 0 11:56 ? 00:00:01 /usr/sap/D61/HDB05/exe/sapstartsrv pf=/usr/sap/D61/SYS/profile/D61_HDB05_wsstadt325 -D -u d61adm
sapadm 1741 1 0 11:56 ? 00:00:04 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
d21adm 1946 1 0 11:56 ? 00:00:02 /usr/sap/D21/ASCS01/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_ASCS01_wsstadt325 -D -u d21adm
d21adm 2182 1 0 11:56 ? 00:00:02 /usr/sap/D21/D00/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_D00_wsstadt325 -D -u d21adm`
Chnaged my script to log the "ps -ef | grep sapstartsrv" output when the system gets rebooted / powered off.
ps -ef | grep sapstartsrv
sapadm 1683 1 0 13:52 ? 00:00:01 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
root 5706 5522 0 14:00 ? 00:00:00 sh -c ps -ef | grep sapstartsrv
root 5708 5706 0 14:00 ? 00:00:00 grep sapstartsrv
The sapstartsrv Service is started by a default SAP Service (sapinit) wich gets startet before my own Systemd Service (So on a reboot it is the reversed order [Stop my Systemd Service -> stop the Sapinit Service]) The problem seems to be that systemctl starts to kill the user session (In my case for the user: d21adm and d61adm) where the sapstartsrv process is running before my actual Systemd service is stopped. (Hope that makes at least a bit sense)
Here's an image of the whole systemd chain (my services are at the very end):
The services involved:
- sapinit.service (The default one)
- saphana.service (My custom one)
linux systemd startup shutdown
add a comment |
We encountered the following problem in our company. We have multiple Red Hat Enterprise Linux Servers on which "SAP HANA S/4" is running.
We created a systemd Service to automatically start and stop the daemon so that we don't need to manually interact with the system on a reboot or shutdown.
Autostart works well, but there seems to be a problem with stopping the daemon correctly on shutdown. The daemons are running with another user (individual for each server). It seems that systemd starts to kill the user sessions before the actual service is stopped; as a result, the service won't stop properly.
Service
[Unit]
Description=saphana
After=remote-fs.target user.slice sapinit.service multi-user.target
Requires=user.slice
[Service]
KillMode=none
Type=oneshot
ExecStart=/hana/source/scripts/sapHanaControl.pl start
ExecStop=/hana/source/scripts/sapHanaControl.pl stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
The script wich is called in ExecStart and ExecStop basically executes the following command.
On Start:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Start"
On Stop:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Stop"
Shutdown log
Output of the Systemd Log shows the following:
Jun 20 16:23:05 host123 systemd[1]: Stopping Session c4 of user **userxy**.
Jun 20 16:23:05 host123sapHanaControl.pl[15003]: sudo -u **userxy** csh -c "sapcontrol -nr 00 -function Stop"
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: 20.06.2018 16:23:05
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: Stop
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
Update
I see the following processes running when the system is running normally:
[root@wsstadt325 ~]# ps -ef | grep sapstartsrv
d61adm 1740 1 0 11:56 ? 00:00:01 /usr/sap/D61/HDB05/exe/sapstartsrv pf=/usr/sap/D61/SYS/profile/D61_HDB05_wsstadt325 -D -u d61adm
sapadm 1741 1 0 11:56 ? 00:00:04 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
d21adm 1946 1 0 11:56 ? 00:00:02 /usr/sap/D21/ASCS01/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_ASCS01_wsstadt325 -D -u d21adm
d21adm 2182 1 0 11:56 ? 00:00:02 /usr/sap/D21/D00/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_D00_wsstadt325 -D -u d21adm`
Chnaged my script to log the "ps -ef | grep sapstartsrv" output when the system gets rebooted / powered off.
ps -ef | grep sapstartsrv
sapadm 1683 1 0 13:52 ? 00:00:01 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
root 5706 5522 0 14:00 ? 00:00:00 sh -c ps -ef | grep sapstartsrv
root 5708 5706 0 14:00 ? 00:00:00 grep sapstartsrv
The sapstartsrv Service is started by a default SAP Service (sapinit) wich gets startet before my own Systemd Service (So on a reboot it is the reversed order [Stop my Systemd Service -> stop the Sapinit Service]) The problem seems to be that systemctl starts to kill the user session (In my case for the user: d21adm and d61adm) where the sapstartsrv process is running before my actual Systemd service is stopped. (Hope that makes at least a bit sense)
Here's an image of the whole systemd chain (my services are at the very end):
The services involved:
- sapinit.service (The default one)
- saphana.service (My custom one)
linux systemd startup shutdown
what if you manually try to stopsapcontrol
? Does the error occur as well?
– sys463
Jun 22 '18 at 9:42
I've found an article, which indicates that NiRawConnect error can occur ifsapstartsrv
service isn't running while stoppingsapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…
– sys463
Jun 22 '18 at 9:58
Manually stopping thesapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with thesapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463
– Reykime
Jun 22 '18 at 11:54
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59
add a comment |
We encountered the following problem in our company. We have multiple Red Hat Enterprise Linux Servers on which "SAP HANA S/4" is running.
We created a systemd Service to automatically start and stop the daemon so that we don't need to manually interact with the system on a reboot or shutdown.
Autostart works well, but there seems to be a problem with stopping the daemon correctly on shutdown. The daemons are running with another user (individual for each server). It seems that systemd starts to kill the user sessions before the actual service is stopped; as a result, the service won't stop properly.
Service
[Unit]
Description=saphana
After=remote-fs.target user.slice sapinit.service multi-user.target
Requires=user.slice
[Service]
KillMode=none
Type=oneshot
ExecStart=/hana/source/scripts/sapHanaControl.pl start
ExecStop=/hana/source/scripts/sapHanaControl.pl stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
The script wich is called in ExecStart and ExecStop basically executes the following command.
On Start:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Start"
On Stop:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Stop"
Shutdown log
Output of the Systemd Log shows the following:
Jun 20 16:23:05 host123 systemd[1]: Stopping Session c4 of user **userxy**.
Jun 20 16:23:05 host123sapHanaControl.pl[15003]: sudo -u **userxy** csh -c "sapcontrol -nr 00 -function Stop"
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: 20.06.2018 16:23:05
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: Stop
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
Update
I see the following processes running when the system is running normally:
[root@wsstadt325 ~]# ps -ef | grep sapstartsrv
d61adm 1740 1 0 11:56 ? 00:00:01 /usr/sap/D61/HDB05/exe/sapstartsrv pf=/usr/sap/D61/SYS/profile/D61_HDB05_wsstadt325 -D -u d61adm
sapadm 1741 1 0 11:56 ? 00:00:04 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
d21adm 1946 1 0 11:56 ? 00:00:02 /usr/sap/D21/ASCS01/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_ASCS01_wsstadt325 -D -u d21adm
d21adm 2182 1 0 11:56 ? 00:00:02 /usr/sap/D21/D00/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_D00_wsstadt325 -D -u d21adm`
Chnaged my script to log the "ps -ef | grep sapstartsrv" output when the system gets rebooted / powered off.
ps -ef | grep sapstartsrv
sapadm 1683 1 0 13:52 ? 00:00:01 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
root 5706 5522 0 14:00 ? 00:00:00 sh -c ps -ef | grep sapstartsrv
root 5708 5706 0 14:00 ? 00:00:00 grep sapstartsrv
The sapstartsrv Service is started by a default SAP Service (sapinit) wich gets startet before my own Systemd Service (So on a reboot it is the reversed order [Stop my Systemd Service -> stop the Sapinit Service]) The problem seems to be that systemctl starts to kill the user session (In my case for the user: d21adm and d61adm) where the sapstartsrv process is running before my actual Systemd service is stopped. (Hope that makes at least a bit sense)
Here's an image of the whole systemd chain (my services are at the very end):
The services involved:
- sapinit.service (The default one)
- saphana.service (My custom one)
linux systemd startup shutdown
We encountered the following problem in our company. We have multiple Red Hat Enterprise Linux Servers on which "SAP HANA S/4" is running.
We created a systemd Service to automatically start and stop the daemon so that we don't need to manually interact with the system on a reboot or shutdown.
Autostart works well, but there seems to be a problem with stopping the daemon correctly on shutdown. The daemons are running with another user (individual for each server). It seems that systemd starts to kill the user sessions before the actual service is stopped; as a result, the service won't stop properly.
Service
[Unit]
Description=saphana
After=remote-fs.target user.slice sapinit.service multi-user.target
Requires=user.slice
[Service]
KillMode=none
Type=oneshot
ExecStart=/hana/source/scripts/sapHanaControl.pl start
ExecStop=/hana/source/scripts/sapHanaControl.pl stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
The script wich is called in ExecStart and ExecStop basically executes the following command.
On Start:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Start"
On Stop:
"sudo -u $username csh -c "sapcontrol -nr $instance -function Stop"
Shutdown log
Output of the Systemd Log shows the following:
Jun 20 16:23:05 host123 systemd[1]: Stopping Session c4 of user **userxy**.
Jun 20 16:23:05 host123sapHanaControl.pl[15003]: sudo -u **userxy** csh -c "sapcontrol -nr 00 -function Stop"
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: 20.06.2018 16:23:05
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: Stop
Jun 20 16:23:05 host123 sapHanaControl.pl[15003]: FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen()
Update
I see the following processes running when the system is running normally:
[root@wsstadt325 ~]# ps -ef | grep sapstartsrv
d61adm 1740 1 0 11:56 ? 00:00:01 /usr/sap/D61/HDB05/exe/sapstartsrv pf=/usr/sap/D61/SYS/profile/D61_HDB05_wsstadt325 -D -u d61adm
sapadm 1741 1 0 11:56 ? 00:00:04 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
d21adm 1946 1 0 11:56 ? 00:00:02 /usr/sap/D21/ASCS01/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_ASCS01_wsstadt325 -D -u d21adm
d21adm 2182 1 0 11:56 ? 00:00:02 /usr/sap/D21/D00/exe/sapstartsrv pf=/usr/sap/D21/SYS/profile/D21_D00_wsstadt325 -D -u d21adm`
Chnaged my script to log the "ps -ef | grep sapstartsrv" output when the system gets rebooted / powered off.
ps -ef | grep sapstartsrv
sapadm 1683 1 0 13:52 ? 00:00:01 /usr/sap/hostctrl/exe/sapstartsrv pf=/usr/sap/hostctrl/exe/host_profile -D
root 5706 5522 0 14:00 ? 00:00:00 sh -c ps -ef | grep sapstartsrv
root 5708 5706 0 14:00 ? 00:00:00 grep sapstartsrv
The sapstartsrv Service is started by a default SAP Service (sapinit) wich gets startet before my own Systemd Service (So on a reboot it is the reversed order [Stop my Systemd Service -> stop the Sapinit Service]) The problem seems to be that systemctl starts to kill the user session (In my case for the user: d21adm and d61adm) where the sapstartsrv process is running before my actual Systemd service is stopped. (Hope that makes at least a bit sense)
Here's an image of the whole systemd chain (my services are at the very end):
The services involved:
- sapinit.service (The default one)
- saphana.service (My custom one)
linux systemd startup shutdown
linux systemd startup shutdown
edited 5 hours ago
Rui F Ribeiro
42.1k1484142
42.1k1484142
asked Jun 22 '18 at 8:04
ReykimeReykime
264
264
what if you manually try to stopsapcontrol
? Does the error occur as well?
– sys463
Jun 22 '18 at 9:42
I've found an article, which indicates that NiRawConnect error can occur ifsapstartsrv
service isn't running while stoppingsapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…
– sys463
Jun 22 '18 at 9:58
Manually stopping thesapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with thesapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463
– Reykime
Jun 22 '18 at 11:54
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59
add a comment |
what if you manually try to stopsapcontrol
? Does the error occur as well?
– sys463
Jun 22 '18 at 9:42
I've found an article, which indicates that NiRawConnect error can occur ifsapstartsrv
service isn't running while stoppingsapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…
– sys463
Jun 22 '18 at 9:58
Manually stopping thesapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with thesapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463
– Reykime
Jun 22 '18 at 11:54
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59
what if you manually try to stop
sapcontrol
? Does the error occur as well?– sys463
Jun 22 '18 at 9:42
what if you manually try to stop
sapcontrol
? Does the error occur as well?– sys463
Jun 22 '18 at 9:42
I've found an article, which indicates that NiRawConnect error can occur if
sapstartsrv
service isn't running while stopping sapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…– sys463
Jun 22 '18 at 9:58
I've found an article, which indicates that NiRawConnect error can occur if
sapstartsrv
service isn't running while stopping sapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…– sys463
Jun 22 '18 at 9:58
Manually stopping the
sapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with the sapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463– Reykime
Jun 22 '18 at 11:54
Manually stopping the
sapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with the sapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463– Reykime
Jun 22 '18 at 11:54
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59
add a comment |
1 Answer
1
active
oldest
votes
Figured out the cause of my problem as described in the following KB
https://www.suse.com/de-de/support/kb/doc/?id=7022671
Systemd kills every user.slice after 90 seconds (This timeout can't be changed) It looks like systemd just isn't made to automatically Stop SAP HANA Instances without modifying pam.d. The Solution described there seems to be a bit "hackish" but it works.
cp /etc/pam.d/system-auth /etc/pam.d/custom-su-session
vim /etc/pam.d/custom-su-session
Insert the following line before "session optional pam_systemd.so"
session [success=1 new_authtok_reqd=ok default=ignore] pam_listfile.so item=user sense=allow file=/etc/custom-su-session
This line skips the user.slice creation when the su command is executed an the user is listed in the file /etc/custom-su-session
vim /etc/pam.d/su
Replace session include system-auth
with session include custom-su-session
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451245%2fcant-properly-stop-sap-hana-on-reboot-shutdown-with-systemd%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Figured out the cause of my problem as described in the following KB
https://www.suse.com/de-de/support/kb/doc/?id=7022671
Systemd kills every user.slice after 90 seconds (This timeout can't be changed) It looks like systemd just isn't made to automatically Stop SAP HANA Instances without modifying pam.d. The Solution described there seems to be a bit "hackish" but it works.
cp /etc/pam.d/system-auth /etc/pam.d/custom-su-session
vim /etc/pam.d/custom-su-session
Insert the following line before "session optional pam_systemd.so"
session [success=1 new_authtok_reqd=ok default=ignore] pam_listfile.so item=user sense=allow file=/etc/custom-su-session
This line skips the user.slice creation when the su command is executed an the user is listed in the file /etc/custom-su-session
vim /etc/pam.d/su
Replace session include system-auth
with session include custom-su-session
add a comment |
Figured out the cause of my problem as described in the following KB
https://www.suse.com/de-de/support/kb/doc/?id=7022671
Systemd kills every user.slice after 90 seconds (This timeout can't be changed) It looks like systemd just isn't made to automatically Stop SAP HANA Instances without modifying pam.d. The Solution described there seems to be a bit "hackish" but it works.
cp /etc/pam.d/system-auth /etc/pam.d/custom-su-session
vim /etc/pam.d/custom-su-session
Insert the following line before "session optional pam_systemd.so"
session [success=1 new_authtok_reqd=ok default=ignore] pam_listfile.so item=user sense=allow file=/etc/custom-su-session
This line skips the user.slice creation when the su command is executed an the user is listed in the file /etc/custom-su-session
vim /etc/pam.d/su
Replace session include system-auth
with session include custom-su-session
add a comment |
Figured out the cause of my problem as described in the following KB
https://www.suse.com/de-de/support/kb/doc/?id=7022671
Systemd kills every user.slice after 90 seconds (This timeout can't be changed) It looks like systemd just isn't made to automatically Stop SAP HANA Instances without modifying pam.d. The Solution described there seems to be a bit "hackish" but it works.
cp /etc/pam.d/system-auth /etc/pam.d/custom-su-session
vim /etc/pam.d/custom-su-session
Insert the following line before "session optional pam_systemd.so"
session [success=1 new_authtok_reqd=ok default=ignore] pam_listfile.so item=user sense=allow file=/etc/custom-su-session
This line skips the user.slice creation when the su command is executed an the user is listed in the file /etc/custom-su-session
vim /etc/pam.d/su
Replace session include system-auth
with session include custom-su-session
Figured out the cause of my problem as described in the following KB
https://www.suse.com/de-de/support/kb/doc/?id=7022671
Systemd kills every user.slice after 90 seconds (This timeout can't be changed) It looks like systemd just isn't made to automatically Stop SAP HANA Instances without modifying pam.d. The Solution described there seems to be a bit "hackish" but it works.
cp /etc/pam.d/system-auth /etc/pam.d/custom-su-session
vim /etc/pam.d/custom-su-session
Insert the following line before "session optional pam_systemd.so"
session [success=1 new_authtok_reqd=ok default=ignore] pam_listfile.so item=user sense=allow file=/etc/custom-su-session
This line skips the user.slice creation when the su command is executed an the user is listed in the file /etc/custom-su-session
vim /etc/pam.d/su
Replace session include system-auth
with session include custom-su-session
answered Jul 9 '18 at 14:07
ReykimeReykime
264
264
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451245%2fcant-properly-stop-sap-hana-on-reboot-shutdown-with-systemd%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what if you manually try to stop
sapcontrol
? Does the error occur as well?– sys463
Jun 22 '18 at 9:42
I've found an article, which indicates that NiRawConnect error can occur if
sapstartsrv
service isn't running while stoppingsapcontrol
. Check it out here: blogs.sap.com/2015/09/07/…– sys463
Jun 22 '18 at 9:58
Manually stopping the
sapcotrol
works well. The error just occours on a reboot or shutdown of the system. As you found out the problem seems to be with thesapstartsrv
service wich in my case is running under a differen user. (Will edit my queston with the new infomation) @sys463– Reykime
Jun 22 '18 at 11:54
Under which user are you running the systemd unit?
– Rui F Ribeiro
Jun 22 '18 at 14:43
Both systemd units are running as root.
– Reykime
Jun 24 '18 at 8:59