[Lunar-commits] <moonbase> openssh: found a better way to make once-ever type services.

Auke Kok sofar at foo-projects.org
Mon Jun 13 07:26:06 CEST 2011


commit bb422f492dd7129ddca3cf80c8039c680ac85974
Author: Auke Kok <auke at foo-projects.org>
Date:   Mon Jun 13 07:26:06 2011 +0200

    openssh: found a better way to make once-ever type services.
---
 crypto/openssh/systemd.d/sshd-keys.service |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/crypto/openssh/systemd.d/sshd-keys.service b/crypto/openssh/systemd.d/sshd-keys.service
index ce75bcb..89f0934 100644
--- a/crypto/openssh/systemd.d/sshd-keys.service
+++ b/crypto/openssh/systemd.d/sshd-keys.service
@@ -1,10 +1,12 @@
 [Unit]
 Description=Create sshd host keys (one time service only)
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
 
 [Service]
 Type=oneshot
 ExecStart=/usr/bin/make -C /etc/ssh server-keys
-ExecStartPost=/bin/ln -s /dev/null /etc/systemd/system/sshd-keys.service
+RemainAfterExit=yes
 
 [Install]
 WantedBy=multi-user.target


More information about the Lunar-commits mailing list