3 ms·
Is your Rust init private? What does it do?
by CameronNemo 6y ago
Is your Rust init private? What does it do?
- tptacek 6y agoMostly just init stuff. We're transforming Docker containers (mostly) into standalone VMs, so it's doing all the scut work of taking a completely stripped-bare booted kernel and getting it to a state where you can run an arbitrary Linux program on it. I wouldn't want to take the thread off on a huge tangent, it's just funny that this was just recently super relevant to me (it would have been problematic if DNS-dependent Go programs depended on libc, because right now I can't assume there's a libc binary to be dynamically linked to). Bringing it back to Go and its (sometimes libc-dependent) DNS libraries: it is very annoying how fiddly it is to get a Go program to use an alternative DNS server.
- JoshTriplett 6y agoI'm currently in the process, right now, of writing a minimal init in Rust to do exactly the same thing. Is yours something you'd consider sharing? The sum total of what I want to do: bring up loopback, bring up the one and only Ethernet interface, set up its IP and basic routing, run another program, and do some basic log reporting.
- tptacek 6y agoI hack on our init, but I didn't write it. So it's not my place to share it. And there's some us-specific stuff in it that wouldn't be super helpful to you. But you could definitely ask Jerome on our team; he's a super helpful guy, even if he's super quiet here (he's like the anti-me). One way or the other I'm sure we can help you get where you're going!
- JoshTriplett 6y agoI reached out to Jerome. Thanks!
- tptacek 6y agoFeel free to follow up with Kurt, me or Michael if you don't get a quick response; Jerome is in Montreal and he may be buried under a mountain of snow and brown gravy.
- alaties 6y agoHad a similar problem a couple years ago where I needed to use alternative DNS libraries to troubleshoot issues in a company's infrastructure. Golang's rules for what implementation to use are found here: https://golang.org/pkg/net/#hdr-Name_Resolution https://golang.org/pkg/net/#hdr-Name_Resolution A really solid alternative DNS client implementation can be found here: https://github.com/miekg/dns https://github.com/miekg/dns. Real easy to read and vet compared to a few other libraries I ran into when working on this problem.
- vidarh 6y agoIf you can can control which DNS servers it talks to, implementing the DNS spec directly is a pretty trivial exercise to get full control. (If you can't, the main complexity is dealing with implementation quirks)