Interrupting process under failsafe console (serial, control-c, ctrl-c, ^c)

More often than I care to admit, I run ping when under failsafe and, at least when connected by serial, can't break out of it with control-c or control-d. When I'm physically close to the box, a power-cycle, while undesirable, seems to be the only option.

Is there a way to "cleanly" break out of programs when running under failsafe and a second connection is not available?

(Running screen on macOS, if it matters)

Well, in the case of ping, I use the -c argument. This explixitly stops ping after N tries.

For a program like top, I've only been able to CTRL+C; but there is also an N iteration argument (-n) as well.

  • I'd suggest using an argument that terminates after N iterations, or
  • Install the full versions of the program you desire

Yes, I'm aware of those options, and already have "real" versions of ping and several other utilities in my images. Unfortunately, after so many years, ping <some-target> is habit and gets occasionally typed, especially when connecting over serial and trying to establish other network connectivity.