Add sshd-keygen.target to abstract key creation from sshd.service and sshd@.service (#1325535)
* PartOf is needed to trigger sshd-keygen checks for sshd.service restarts * sshd-keygen.target makes a level of abstraction to eliminate dupplicate dependencies on both sshd and sshd@ services
This commit is contained in:
parent
461b3af818
commit
5489ace8dc
@ -89,6 +89,7 @@ Source11: sshd.service
|
|||||||
Source12: sshd-keygen@.service
|
Source12: sshd-keygen@.service
|
||||||
Source13: sshd-keygen
|
Source13: sshd-keygen
|
||||||
Source14: sshd.tmpfiles
|
Source14: sshd.tmpfiles
|
||||||
|
Source15: sshd-keygen.target
|
||||||
|
|
||||||
# Internal debug
|
# Internal debug
|
||||||
Patch0: openssh-5.9p1-wIm.patch
|
Patch0: openssh-5.9p1-wIm.patch
|
||||||
@ -649,6 +650,7 @@ install -m644 %{SOURCE9} $RPM_BUILD_ROOT/%{_unitdir}/sshd@.service
|
|||||||
install -m644 %{SOURCE10} $RPM_BUILD_ROOT/%{_unitdir}/sshd.socket
|
install -m644 %{SOURCE10} $RPM_BUILD_ROOT/%{_unitdir}/sshd.socket
|
||||||
install -m644 %{SOURCE11} $RPM_BUILD_ROOT/%{_unitdir}/sshd.service
|
install -m644 %{SOURCE11} $RPM_BUILD_ROOT/%{_unitdir}/sshd.service
|
||||||
install -m644 %{SOURCE12} $RPM_BUILD_ROOT/%{_unitdir}/sshd-keygen@.service
|
install -m644 %{SOURCE12} $RPM_BUILD_ROOT/%{_unitdir}/sshd-keygen@.service
|
||||||
|
install -m644 %{SOURCE15} $RPM_BUILD_ROOT/%{_unitdir}/sshd-keygen.target
|
||||||
install -m744 %{SOURCE13} $RPM_BUILD_ROOT/%{_libexecdir}/openssh/sshd-keygen
|
install -m744 %{SOURCE13} $RPM_BUILD_ROOT/%{_libexecdir}/openssh/sshd-keygen
|
||||||
install -m755 contrib/ssh-copy-id $RPM_BUILD_ROOT%{_bindir}/
|
install -m755 contrib/ssh-copy-id $RPM_BUILD_ROOT%{_bindir}/
|
||||||
install contrib/ssh-copy-id.1 $RPM_BUILD_ROOT%{_mandir}/man1/
|
install contrib/ssh-copy-id.1 $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||||
@ -770,6 +772,7 @@ getent passwd sshd >/dev/null || \
|
|||||||
%attr(0644,root,root) %{_unitdir}/sshd@.service
|
%attr(0644,root,root) %{_unitdir}/sshd@.service
|
||||||
%attr(0644,root,root) %{_unitdir}/sshd.socket
|
%attr(0644,root,root) %{_unitdir}/sshd.socket
|
||||||
%attr(0644,root,root) %{_unitdir}/sshd-keygen@.service
|
%attr(0644,root,root) %{_unitdir}/sshd-keygen@.service
|
||||||
|
%attr(0644,root,root) %{_unitdir}/sshd-keygen.target
|
||||||
%attr(0644,root,root) %{_tmpfilesdir}/openssh.conf
|
%attr(0644,root,root) %{_tmpfilesdir}/openssh.conf
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
5
sshd-keygen.target
Normal file
5
sshd-keygen.target
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[Unit]
|
||||||
|
Wants=sshd-keygen@rsa.service
|
||||||
|
Wants=sshd-keygen@ecdsa.service
|
||||||
|
Wants=sshd-keygen@ed25519.service
|
||||||
|
PartOf=sshd.service
|
@ -1,9 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenSSH %i Server Key Generation
|
Description=OpenSSH %i Server Key Generation
|
||||||
ConditionFileNotEmpty=|!/etc/ssh/ssh_host_%i_key
|
ConditionFileNotEmpty=|!/etc/ssh/ssh_host_%i_key
|
||||||
Before=sshd.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
EnvironmentFile=-/etc/sysconfig/sshd
|
EnvironmentFile=-/etc/sysconfig/sshd
|
||||||
ExecStart=/usr/libexec/openssh/sshd-keygen %i
|
ExecStart=/usr/libexec/openssh/sshd-keygen %i
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sshd-keygen.target
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenSSH server daemon
|
Description=OpenSSH server daemon
|
||||||
Documentation=man:sshd(8) man:sshd_config(5)
|
Documentation=man:sshd(8) man:sshd_config(5)
|
||||||
After=network.target sshd-keygen.service
|
After=network.target sshd-keygen.target
|
||||||
Wants=sshd-keygen@rsa.service
|
Wants=sshd-keygen.target
|
||||||
Wants=sshd-keygen@ecdsa.service
|
|
||||||
Wants=sshd-keygen@ed25519.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenSSH per-connection server daemon
|
Description=OpenSSH per-connection server daemon
|
||||||
Documentation=man:sshd(8) man:sshd_config(5)
|
Documentation=man:sshd(8) man:sshd_config(5)
|
||||||
Wants=sshd-keygen.service
|
Wants=sshd-keygen.target
|
||||||
After=sshd-keygen.service
|
After=sshd-keygen.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=-/etc/sysconfig/sshd
|
EnvironmentFile=-/etc/sysconfig/sshd
|
||||||
|
Loading…
Reference in New Issue
Block a user