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 socket activation and .service/.socket files #2054

Closed
wants to merge 1 commit into from

Conversation

canoon
Copy link

@canoon canoon commented Oct 1, 2013

Like #1534 but adds in socket activation via systemd. Allows systemd to just open the socket and launch docker when required.

@@ -28,7 +28,7 @@ func open() (pty, tty *os.File, err error) {
return nil, nil, err
}

t, err := os.OpenFile(sname, os.O_RDWR, 0)
t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed for this PR ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have to agree with @vieux here - I think we should only touch vendor/ to update from upstream code. If upstream can't move quickly enough, then we have to evaluate making our own fork and changing our upstream. If this is a problem for this PR, then it needs to be blocked on #1422, and we need to resolve that upstream (ie kr/pty#9).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #2066.

@canoon
Copy link
Author

canoon commented Oct 2, 2013

Whoops amending that commit seemed to have deleted your comments. I tried to sneak that in on the basis that the upstream one would have been fixed anyway. It's not really required but otherwise just has the same issue as #1422 .

@tianon
Copy link
Member

tianon commented Oct 2, 2013

The comments are still there on "an outdated diff". Github figures that you amended that line to fix our concerns (which you did), so the outdated comments are hidden. 👍

@shykes
Copy link
Contributor

shykes commented Nov 11, 2013

Hey @canoon, sorry for the slow review. I really want to get this merged. Here are some comments:

  • Listening on FDs should not be a special case. It should be passed as an option by the user with -H just like other listeners. I suggest a syntax like "-H fd://3" for individual FDs, and "-H fd://*" for all fds.
  • We have been refactoring this part of the code so your PR doesn't merge cleanly. Since the refactoring is still underway I don't want to ask you to track it. Instead I suggest we agree on a prototype for a function, you contribute that function, and we take care of calling it.

How about this prototype:

// Call examples:
//
// If the user passes 'docker -d -H fd://3'
// listeners, err := ListenFD("3")
//
// If the user passes 'docker -d -H "fd://*"'
// listeners, err := ListenFD("*")
func ListenFD(addr string) ([]net.Listener, error) {

}

If you can put that in utils/systemd.go that would be great. We'll reserve it for you :)

Thanks!

@philips
Copy link
Contributor

philips commented Nov 14, 2013

@canoon @tianon If neither of you are taking this I can do it. Also, we have a go-systemd library with an activation package: https://github.com/coreos/go-systemd/

@philips
Copy link
Contributor

philips commented Nov 14, 2013

Here is a quick implementation of the ListenFD function: https://github.com/philips/docker/compare/add-socket-activation

@shykes Where is the refactoring taking place so I can try and fit this in?

@EpocSquadron
Copy link

Bump.

@shykes
Copy link
Contributor

shykes commented Nov 30, 2013

Back from the 0.7 craziness. @philips it looks like nobody is active on this so feel free to dive in :)

@vieux
Copy link
Contributor

vieux commented Dec 5, 2013

@canoon can you rebase and use the systemd package newly created ?

@philips
Copy link
Contributor

philips commented Dec 5, 2013

@vieux Docker is implementing a systemd library? We already have a systemd library that has socket activation with tests and I was going to use that. https://github.com/coreos/go-systemd

@vieux
Copy link
Contributor

vieux commented Dec 5, 2013

@philips I was talking about 066b961

@shykes
Copy link
Contributor

shykes commented Dec 5, 2013

@philips it's just a subdir for the systemd-specific parts of docker.

On Thu, Dec 5, 2013 at 11:31 AM, Victor Vieux notifications@github.com
wrote:

@philips I was talking about 066b961

Reply to this email directly or view it on GitHub:
#2054 (comment)

@philips
Copy link
Contributor

philips commented Dec 5, 2013

@shykes @vieux OK, I will add the ListenFD thing into docker/systemd then. Thanks. Hope to have a PR by the EOD.

@crosbymichael
Copy link
Contributor

@philips Does your new PR completely replace this one ?

@philips
Copy link
Contributor

philips commented Dec 13, 2013

@crosbymichael Yes.

@crosbymichael
Copy link
Contributor

Closing in favor of #3105

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 this pull request may close these issues.

None yet

7 participants