From 009f534b098b73eb4c1e24161b94da51cf2075f3 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Fri, 6 Apr 2012 21:01:06 +0200 Subject: [PATCH] don't install sshd-keygen.service (#810419) --- openssh.spec | 9 ++++----- sshd.service | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openssh.spec b/openssh.spec index d6db2bb..842b351 100644 --- a/openssh.spec +++ b/openssh.spec @@ -609,7 +609,7 @@ install -m755 %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd install -m644 %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/sshd install -m755 %{SOURCE13} $RPM_BUILD_ROOT/%{_sbindir}/sshd-keygen install -d -m755 $RPM_BUILD_ROOT/%{_unitdir} -install -m644 %{SOURCE8} $RPM_BUILD_ROOT/%{_unitdir}/sshd-keygen.service +# install -m644 %{SOURCE8} $RPM_BUILD_ROOT/%{_unitdir}/sshd-keygen.service # install -m644 %{SOURCE9} $RPM_BUILD_ROOT/%{_unitdir}/sshd@.service # install -m644 %{SOURCE10} $RPM_BUILD_ROOT/%{_unitdir}/sshd.socket install -m644 %{SOURCE11} $RPM_BUILD_ROOT/%{_unitdir}/sshd.service @@ -677,7 +677,6 @@ fi if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable sshd.service > /dev/null 2>&1 || : - /bin/systemctl --no-reload disable sshd-keygen.service > /dev/null 2>&1 || : /bin/systemctl stop sshd.service > /dev/null 2>&1 || : fi @@ -686,8 +685,9 @@ fi /bin/systemctl enable sshd.service >/dev/null 2>&1 /sbin/chkconfig --del sshd >/dev/null 2>&1 || : /bin/systemctl try-restart sshd.service >/dev/null 2>&1 || : -# This one was never a service, so we don't simply restart it -/bin/systemctl is-active -q sshd.service && /bin/systemctl start sshd-keygen.service >/dev/null 2>&1 || : + +%triggerun -n openssh-server -- openssh-server < 5.9p1-22 +/bin/systemctl --no-reload disable sshd-keygen.service >/dev/null 2>&1 || : %triggerpostun -n openssh-server-sysvinit -- openssh-server < 5.8p2-12 /sbin/chkconfig --add sshd >/dev/null 2>&1 || : @@ -751,7 +751,6 @@ fi %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config %attr(0644,root,root) %config(noreplace) /etc/pam.d/sshd %attr(0640,root,root) %config(noreplace) /etc/sysconfig/sshd -%attr(0644,root,root) %{_unitdir}/sshd-keygen.service %attr(0644,root,root) %{_unitdir}/sshd.service # %files server-ondemand diff --git a/sshd.service b/sshd.service index f32055a..a2935cc 100644 --- a/sshd.service +++ b/sshd.service @@ -1,10 +1,10 @@ [Unit] Description=OpenSSH server daemon After=syslog.target network.target auditd.service -Wants=sshd-keygen.service [Service] EnvironmentFile=/etc/sysconfig/sshd +ExecStartPre=/usr/sbin/sshd-keygen ExecStart=/usr/sbin/sshd -D $OPTIONS ExecReload=/bin/kill -HUP $MAINPID