Accepting request 599201 from home:eeich:branches:network:cluster
- Avoid running pretrans scripts when running in an instsys: there may be not much installed, yet. pretrans code should be done in lua, this way, it will be executed by the rpm-internal lua interpreter and not be passed to a shell which may not be around at the time this scriptlet is run (bsc#1090292). OBS-URL: https://build.opensuse.org/request/show/599201 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=56
This commit is contained in:
parent
df7fca5b1f
commit
7d56316590
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 19 21:05:04 UTC 2018 - eich@suse.com
|
||||
|
||||
- Avoid running pretrans scripts when running in an instsys:
|
||||
there may be not much installed, yet. pretrans code should
|
||||
be done in lua, this way, it will be executed by the rpm-internal
|
||||
lua interpreter and not be passed to a shell which may not be
|
||||
around at the time this scriptlet is run (bsc#1090292).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 13 10:03:05 UTC 2018 - eich@suse.com
|
||||
|
||||
|
15
slurm.spec
15
slurm.spec
@ -564,18 +564,25 @@ exit 0
|
||||
# plugins has changed as updates are not atomic. Since we cannot
|
||||
# fix the old scripts we need these macros as a workaround.
|
||||
# They should be removed at some point.
|
||||
%define _test_rest() %{?with_systemd:rm -f /run/%{1}.rst; systemctl status %{1} &>/dev/null && touch /run/%{1}.rst || :;}
|
||||
# Do pretrans in lua: https://fedoraproject.org/wiki/Packaging:Scriptlets
|
||||
%define _test_rest() %{?with_systemd: os.remove("/run/%{1}.rst")
|
||||
if os.execute() and os.getenv("YAST_IS_RUNNING") ~= "instsys" then
|
||||
if os.execute("systemctl status %{1} &>/dev/null") then
|
||||
f=io.open("/run/%{1}.rst","w"); f:close()
|
||||
end
|
||||
end
|
||||
}
|
||||
%define _rest() %{?with_systemd:[ -e /run/%{1}.rst ] && { systemctl status %{1} &>/dev/null || systemctl restart %{1}; }; rm -f /run/%{1}.rst;}
|
||||
# Until a posttrans macro has been added to macros.systemd, we need this
|
||||
%define _res_update() %{?with_systemd:%{expand:%%_restart_on_update %{?*}};}
|
||||
|
||||
%pretrans
|
||||
%pretrans -p <lua>
|
||||
%_test_rest slurmctld
|
||||
|
||||
%pretrans node
|
||||
%pretrans node -p <lua>
|
||||
%_test_rest slurmd
|
||||
|
||||
%pretrans slurmdbd
|
||||
%pretrans slurmdbd -p <lua>
|
||||
%_test_rest slurmdbd
|
||||
|
||||
%posttrans
|
||||
|
Loading…
Reference in New Issue
Block a user