Accepting request 865536 from home:hpjansson:branches:network

- Make sure sshd is enabled correctly when upgrading from a
  pre-systemd distribution (bsc#1180083).

OBS-URL: https://build.opensuse.org/request/show/865536
OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=223
This commit is contained in:
Hans Petter Jansson 2021-01-22 03:01:20 +00:00 committed by Git OBS Bridge
parent 6543c1a02b
commit dcc585e9d2
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 22 02:54:02 UTC 2021 - Hans Petter Jansson <hpj@suse.com>
- Make sure sshd is enabled correctly when upgrading from a
pre-systemd distribution (bsc#1180083).
-------------------------------------------------------------------
Mon Jan 18 00:30:37 UTC 2021 - Dirk Müller <dmueller@suse.com>

View File

@ -346,9 +346,12 @@ done
# %%service_add_post scriptlet (in %%post server) will see it as a new service
# and apply the preset, disabling it. We need to reenable it afterwards if
# necessary.
mkdir -p %{_tmpenableddir} || :
if [ -x %{_bindir}/systemctl ]; then
mkdir -p %{_tmpenableddir} || :
%{_bindir}/systemctl is-enabled sshd > %{_tmpenabledfile} || :
else
if [ x$(find %{_sysconfdir}/init.d/rc[35].d -name 'S*' -type l -exec readlink -f {} \; | grep sshd$ | uniq) \
== x%{_sysconfdir}/init.d/sshd ]; then echo "enabled" > %{_tmpenabledfile} || :; fi
fi
%pre server
@ -361,9 +364,12 @@ test -f /etc/pam.d/sshd.rpmsave && mv -v /etc/pam.d/sshd.rpmsave /etc/pam.d/sshd
# See %%pre.
mkdir -p %{_tmpenableddir} || :
if [ -x %{_bindir}/systemctl ]; then
mkdir -p %{_tmpenableddir} || :
%{_bindir}/systemctl is-enabled sshd > %{_tmpenabledfile} || :
else
if [ x$(find %{_sysconfdir}/init.d/rc[35].d -name 'S*' -type l -exec readlink -f {} \; | grep sshd$ | uniq) \
== x%{_sysconfdir}/init.d/sshd ]; then echo "enabled" > %{_tmpenabledfile} || :; fi
fi
%service_add_pre sshd.service