consrv icon indicating copy to clipboard operation
consrv copied to clipboard

feature request: consrv-side buffering for interrupted connections

Open stapelberg opened this issue 2 years ago • 1 comments

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

stapelberg avatar Jun 28 '22 07:06 stapelberg

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

mdlayher avatar Jun 28 '22 16:06 mdlayher

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.

stapelberg avatar Aug 13 '22 21:08 stapelberg

Yep, seems reasonable to me.

mdlayher avatar Aug 13 '22 23:08 mdlayher