Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd #67

Closed
porjo opened this issue Jul 17, 2014 · 12 comments · Fixed by #73
Closed

systemd #67

porjo opened this issue Jul 17, 2014 · 12 comments · Fixed by #73

Comments

@porjo
Copy link

porjo commented Jul 17, 2014

It'd be great if skydns supported systemd socket activation. For example, if no -addr is specified, then it would check to see if systemd has supplied any sockets, otherwise go with default 127.0.0.1:53.

I looked at go-systemd unfortunately it currently only supports TCP sockets, however there is an open issue for UDP support.

@miekg
Copy link

miekg commented Jul 17, 2014

That sounds like an interesting plan.
On 17 Jul 2014 07:21, "Ian Bishop" notifications@github.com wrote:

It'd be great if skydns supported systemd socket activation. For example,
if no -addr is specified, then it would first check to see if systemd has
supplied any sockets, otherwise go with default 127.0.0.1:53.

I looked at using go-systemd https://github.com/coreos/go-systemd
unfortunately it currently only supports TCP sockets, however there is an open
ticket coreos/go-systemd#27 for UDP support.


Reply to this email directly or view it on GitHub
#67.

@porjo
Copy link
Author

porjo commented Jul 18, 2014

I've been looking into this some more. I've sent PR coreos/go-systemd#54 to add UDP support to go-systemd.

It looks like both skydns and miekg/dns will need changes. Assuming my PR is accepted, go-systemd will produce 2 slices: []net.Listener for TCP, and []net.PacketConn for UDP.

server.go Run() could be modified to launch servers for each one, however I'm not sure the best way to modify dns.Server in order to pass the corresponding Listener/PacketConn through - @miekg any suggestions?

@miekg
Copy link

miekg commented Jul 18, 2014

[ Quoting notifications@github.com in "Re: [skydns] systemd (#67)..." ]

I've been looking into this some more. I've sent PR coreos/go-systemd#54 to add UDP support to go-systemd.

It looks like both skydns and miekg/dns will need changes. Assuming my PR is accepted, go-systemd will produce 2 slices: []net.Listener for TCP, and []net.PacketConn for UDP.

server.go Run() could be modified to launch servers for each one, however I'm not sure the best way to modify dns.Server in order to pass the corresponding Listener/PacketConn through - @miekg any suggestions?

Nice thanks.

I think in dns.Server there just needs to be ListenAndServeXXX (need to think
of a cool short name) that accepts this fluff and starts a server. Go changes
are (I think) minimal. Small issue is that I don't want 3rd party dependencies
in Go DNS, so I need to copy/implement some stuff myself.

Or can we pull out the absolute minimum from go-systemd and put that in Go dns?

/Miek

Miek Gieben

@mattwilliamson
Copy link

+1

@miekg
Copy link

miekg commented Jul 18, 2014

We would need https://github.com/coreos/go-systemd/tree/master/activation which has four files, two of which are tests, the other two are trivial. Could you open PR against Go DNS instead? The two existing files can be reimplemented as well, so we can put the whole thing under the MIT license.

@miekg
Copy link

miekg commented Jul 18, 2014

On socket thought most stuff needs to be in skydns. Preparing a small branch for Go dns that has the important bits for the server.

@miekg
Copy link

miekg commented Jul 18, 2014

Proof of concept in https://github.com/miekg/dns/tree/systemd

@porjo
Copy link
Author

porjo commented Jul 19, 2014

I've created 'systemd' branches for skydns and miekg/dns which demonstrates a working implementation (tested in systemd environment).

porjo/skydns@skynetservices:master...systemd
porjo/dns@miekg:systemd...systemd

Some thoughts:

  • the interface between skydns and miekg/dns is pretty ugly and could use some improvement.
  • @miekg are you happy to use go-systemd in skydns, or would you prefer to re-implement?
  • not sure if the new systemd boolean flag is the best approach here for enabling the functionality

@miekg
Copy link

miekg commented Jul 19, 2014

Awesome, when I am back home I'll take a look.
On 19 Jul 2014 12:26, "Ian Bishop" notifications@github.com wrote:

I've created 'systemd' branches for skydns and miekg/dns which
demonstrates a working implementation (tested in systemd environment).

porjo@skynetservices:master...systemd
porjo/skydns@skynetservices:master...systemd
porjo/dns@miekg:systemd...systemd
porjo/dns@miekg:systemd...systemd

Some thoughts:

  • the interface between skydns and miekg/dns is pretty ugly and could
    use some improvement.
  • @miekg https://github.com/miekg are you happy to use go-systemd in
    skydns, or would you prefer to re-implement?
  • not sure if the new systemd boolean flag is the best approach here
    for enabling the functionality


Reply to this email directly or view it on GitHub
#67 (comment)
.

@miekg
Copy link

miekg commented Jul 20, 2014

I'm fine btw with relying on go-systemd in SkyDNS, its already depending on other coreos packages.

@porjo
Copy link
Author

porjo commented Jul 20, 2014

I've refactored both branches now to (hopefully) make the interface between skydns and dns a bit cleaner: rather than having net.TCPListener and net.PacketConn in dns.Server, just call dns.ServeTCP() and dns.ServeUDP() directly from skydns.

@porjo
Copy link
Author

porjo commented Jul 23, 2014

I've refactored the skydns systemd branch in response to @miekg's recent commit to dns/systemd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants