diff --git a/slurm.changes b/slurm.changes index 36862c9..3044217 100644 --- a/slurm.changes +++ b/slurm.changes @@ -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 diff --git a/slurm.spec b/slurm.spec index 19491df..7889afc 100644 --- a/slurm.spec +++ b/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 %_test_rest slurmctld -%pretrans node +%pretrans node -p %_test_rest slurmd -%pretrans slurmdbd +%pretrans slurmdbd -p %_test_rest slurmdbd %posttrans