File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -620,7 +620,11 @@ rm -rf $RPM_BUILD_ROOT
620620%pre -n %{real_name }
621621
622622/usr/bin/systemctl --now mask mariadb
623- /usr/bin/systemctl stop systemd-logind
623+
624+ # This (extremelly) ugly hack below will make the current processes part of a cgroup other than the one for user-0.slice
625+ # This will allow for the current shells that are opened to be protected against stopping when we'll be calling isolate below which stops user-0.slice
626+ # New shells will not be placed into user-0.slice since systemd-logind will be disabled and masked
627+ /bin/bash -c "/usr/bin/systemctl status user-0.slice | /usr/bin/egrep -o '─[0-9]+' | /usr/bin/sed 's/─//g' | /usr/bin/xargs -I{} /bin/bash -c '/usr/bin/kill -0 {} > /dev/null 2> /dev/null && /usr/bin/echo {} > /sys/fs/cgroup/systemd/tasks'"/usr/bin/systemctl stop systemd-logind
624628/usr/bin/systemctl --now mask systemd-logind
625629/usr/bin/systemctl daemon-reload
626630
You can’t perform that action at this time.
0 commit comments