Commit 81ab90a4 authored by Marek Belisko's avatar Marek Belisko
Browse files

openssh: Added condition for service startup


Signed-off-by: default avatarMarek Belisko <marek.belisko@open-nandra.com>
parent bff8971a
......@@ -3,6 +3,7 @@ Description=OpenBSD Secure Shell server
After=network.target auditd.service
Wants=sshdgenkeys.service
After=sshdgenkeys.service
ConditionPathExists=/data/systemd/service/ssh/enabled
[Service]
EnvironmentFile=-/etc/default/ssh
......
......@@ -14,12 +14,17 @@ do_install_append() {
${D}${sysconfdir}/systemd/system/multi-user.target.wants/sshdgenkeys.service
# Create config files for read-only rootfs (store it in data)
install -d ${D}${sysconfdir}/ssh
install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
install -d ${D}${sysconfdir}/ssh
install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
echo "HostKey /data/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
echo "HostKey /data/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
echo "HostKey /data/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
# create directory for enable/disable service file
install -d ${D}/data/systemd/service
}
SYSTEMD_SERVICE_${PN}-sshd = "sshdgenkeys.service"
SYSTEMD_SERVICE_${PN}-sshd = "sshdgenkeys.service ssh.service"
FILES_${PN} += "/data/*"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment