mdlayher / consrv

Command consrv is a SSH to serial console bridge server, originally designed for deployment on gokrazy.org devices. Apache 2.0 Licensed.
Other
136 stars 4 forks source link

feature request: consrv-side buffering for interrupted connections #2

Closed stapelberg closed 2 years ago

stapelberg commented 2 years ago

Hey 👋

I started using consrv recently (blog post coming soonish) :)

I not only use serial console for interactive on-demand access, but also for continuous, always-on logging.

Because I started suspending my PC to RAM over night, I have gaps in my serial console logs.

I was wondering what you think about making consrv store serial logs (either in RAM, and/or on disk) while the client is disconnected? Once the client reconnects, consrv would stream what the client missed.

Thanks

mdlayher commented 2 years ago

Sounds cool! I'd be happy to accept a PR.

stapelberg commented 2 years ago

Thinking more about it, the following approach seems simpler overall: instead of making consrv do all the buffering and replay, we could instead just launch a goroutine that reads from the mux device and prints to stdout. In combination with https://github.com/gokrazy/syslogd and https://gokrazy.org/userguide/remotesyslog/, the logs can either be sent to a central syslog server, or sent to localhost and persisted to RAM or any other available storage via syslogd.

mdlayher commented 2 years ago

Yep, seems reasonable to me.