From 6157db67c1be1e06a119d09dbbd64b28ed30ca5c Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 12 Mar 2025 13:25:30 +0200 Subject: [PATCH] Switch from Systemd to Enit --- source-files/ssh-keygen.esv | 5 +++++ source-files/sshd-keygen.service | 12 ------------ source-files/sshd.esv | 6 ++++++ source-files/sshd.service | 11 ----------- source.sh | 23 +++++++++++++---------- 5 files changed, 24 insertions(+), 33 deletions(-) create mode 100644 source-files/ssh-keygen.esv delete mode 100644 source-files/sshd-keygen.service create mode 100644 source-files/sshd.esv delete mode 100644 source-files/sshd.service diff --git a/source-files/ssh-keygen.esv b/source-files/ssh-keygen.esv new file mode 100644 index 0000000..b4d0bd6 --- /dev/null +++ b/source-files/ssh-keygen.esv @@ -0,0 +1,5 @@ +name: ssh-keygen +description: Generate SSH keys +type: simple +start_cmd: /usr/bin/ssh-keygen -A +exit_method: kill diff --git a/source-files/sshd-keygen.service b/source-files/sshd-keygen.service deleted file mode 100644 index 00d19d9..0000000 --- a/source-files/sshd-keygen.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Generate sshd keys -Before=ssh.server - -[Service] -Type=oneshot -ExecStart=/usr/bin/ssh-keygen -A -RemainAfterExit=true -StandardOutput=journal - -[Install] -WantedBy=multi-user.target diff --git a/source-files/sshd.esv b/source-files/sshd.esv new file mode 100644 index 0000000..c2ddf15 --- /dev/null +++ b/source-files/sshd.esv @@ -0,0 +1,6 @@ +name: sshd +description: OpenSSH Daemon +type: background +start_cmd: /sbin/sshd -D +exit_method: kill +restart: true diff --git a/source-files/sshd.service b/source-files/sshd.service deleted file mode 100644 index e4d6c4f..0000000 --- a/source-files/sshd.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenSSH Daemon - -[Service] -ExecStart=/usr/sbin/sshd -D -ExecReload=/bin/kill -HUP $MAINPID -KillMode=process -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/source.sh b/source.sh index 7a04999..2509d3d 100644 --- a/source.sh +++ b/source.sh @@ -35,16 +35,19 @@ check() { # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install - install -v -m755 contrib/ssh-copy-id "$BPM_OUTPUT"/usr/bin - install -v -m644 contrib/ssh-copy-id.1 "$BPM_OUTPUT"/usr/share/man/man1 - mkdir -p "$BPM_OUTPUT"/etc/pam.d - cp ../sshd-pam "$BPM_OUTPUT"/etc/pam.d/sshd - cp ../sshd_config "$BPM_OUTPUT"/etc/ssh/sshd_config - mkdir -p "$BPM_OUTPUT"/usr/lib/systemd/system/ - cp ../sshd.service "$BPM_OUTPUT"/usr/lib/systemd/system/sshd.service - cp ../sshd-keygen.service "$BPM_OUTPUT"/usr/lib/systemd/system/sshd-keygen.service + + install -m755 contrib/ssh-copy-id "$BPM_OUTPUT"/usr/bin + install -m644 contrib/ssh-copy-id.1 "$BPM_OUTPUT"/usr/share/man/man1 + + install -Dm644 "$BPM_WORKDIR"/sshd-pam "$BPM_OUTPUT"/etc/pam.d/sshd + + install -Dm644 "$BPM_WORKDIR"/sshd_config "$BPM_OUTPUT"/etc/ssh/sshd_config + + install -Dm644 "$BPM_WORKDIR"/sshd.esv "$BPM_OUTPUT"/etc/esvm/services/sshd.esv + install -Dm644 "$BPM_WORKDIR"/ssh-keygen.esv "$BPM_OUTPUT"/etc/esvm/services/ssh-keygen.esv + install -v -m755 -d "$BPM_OUTPUT"/usr/share/doc/openssh install -v -m644 INSTALL LICENCE OVERVIEW README* "$BPM_OUTPUT"/usr/share/doc/openssh - mkdir -p "$BPM_OUTPUT"/usr/share/licenses/openssh - cp LICENCE "$BPM_OUTPUT"/usr/share/licenses/openssh/LICENSE + + install -Dm644 LICENCE "$BPM_OUTPUT"/usr/share/licenses/openssh/LICENSE }