Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/3] Refactor OpenSSH init.d script
@ 2024-07-04 10:16 Fiona Klute via buildroot
  2024-07-04 10:16 ` [Buildroot] [PATCH v4 1/3] package/openssh: manage sshd using start-stop-daemon Fiona Klute via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Fiona Klute via buildroot @ 2024-07-04 10:16 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E . MORIN, Fiona Klute (WIWA)

From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>

This series is the result of running "/etc/init.d/S50sshd restart"
over an SSH connection and finding that not only it destroyed my SSH
session (this is no longer issue with OpenSSH 9.8), the SSH server
also did not come back up. The main issue there was the use of
"killall sshd" instead of stopping only the listening server (patch
1). I assume restarting the SSH server on a Buildroot-created system
is not a common use case, I need a reload to reset its state during
automated tests.

I took the opportunity to make some more improvements: manage sshd
using start-stop-daemon, including error checks (patch 1), style
cleanup (patch 2), and implementing "reload" using SIGHUP (patch 3).

The added checks for a currently running service before
start/stop/reload bring a slight change in behavior, there will be a
non-zero exit code when trying to start when sshd is already running,
or stop/reload when it's not. I consider this useful to find errors in
scripts instead of masking them, but I don't mind removing that if
it's considered a problem.

Changes v3 -> v4:
* Avoid start-stop-daemon --retry option, the Busybox implementation
  silently ignores it.

Changes v2 -> v3:
* Manage sshd using start-stop-daemon (patches 1, 3), making patch 4
  obsolete (dropped from the series).
* Set DAEMON variable, the complete series now removes all checkpatch
  warnings for the init script (patch 1).

Changes v1 -> v2:
* Acknowledge changed session binary with OpenSSH 9.8 in commit
  message (patch 1)
* Check sshd exit code on service start (patch 4)

Fiona Klute (WIWA) (3):
  package/openssh: manage sshd using start-stop-daemon
  package/openssh: fix init script indentation
  package/openssh: implement "reload" using SIGHUP

 .checkpackageignore     |  1 -
 package/openssh/S50sshd | 65 +++++++++++++++++++++++++++++------------
 2 files changed, 47 insertions(+), 19 deletions(-)

--
2.45.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-10 17:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 10:16 [Buildroot] [PATCH v4 0/3] Refactor OpenSSH init.d script Fiona Klute via buildroot
2024-07-04 10:16 ` [Buildroot] [PATCH v4 1/3] package/openssh: manage sshd using start-stop-daemon Fiona Klute via buildroot
2024-07-04 10:16 ` [Buildroot] [PATCH v4 2/3] package/openssh: fix init script indentation Fiona Klute via buildroot
2024-07-04 10:16 ` [Buildroot] [PATCH v4 3/3] package/openssh: implement "reload" using SIGHUP Fiona Klute via buildroot
2024-07-08 21:53 ` [Buildroot] [PATCH v4 0/3] Refactor OpenSSH init.d script Thomas Petazzoni via buildroot
2024-07-09  9:55   ` Fiona Klute via buildroot
2024-07-09 10:06     ` Thomas Petazzoni via buildroot
2024-07-09 11:31       ` Fiona Klute via buildroot
2024-07-09 11:44         ` yann.morin
2024-07-10 17:39           ` Fiona Klute via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox