forked from pool/openssh
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:
parent
6543c1a02b
commit
dcc585e9d2
@ -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>
|
||||
|
||||
|
10
openssh.spec
10
openssh.spec
@ -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.
|
||||
if [ -x %{_bindir}/systemctl ]; then
|
||||
mkdir -p %{_tmpenableddir} || :
|
||||
if [ -x %{_bindir}/systemctl ]; then
|
||||
%{_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.
|
||||
if [ -x %{_bindir}/systemctl ]; then
|
||||
mkdir -p %{_tmpenableddir} || :
|
||||
if [ -x %{_bindir}/systemctl ]; then
|
||||
%{_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
|
||||
|
Loading…
Reference in New Issue
Block a user