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

Have docker register its machine with systemd #13526

Closed
wants to merge 1 commit into from

Conversation

rhatdan
Copy link
Contributor

@rhatdan rhatdan commented May 28, 2015

This patch will register the container with machinectl. This will allow tools
on the container like machinectl and eventually journalctl to interact with the
container.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

@rhatdan
Copy link
Contributor Author

rhatdan commented Jun 10, 2015

Crickets? @jfrazelle @crosbymichael @tianon

@icecrime
Copy link
Contributor

@rhatdan What kind of interactions will this enable? I'm assuming list is one thing, but what about the rest? Is the goal to expand support for more machinectl commands afterwards?

@rhatdan
Copy link
Contributor Author

rhatdan commented Jun 27, 2015

Yes I would like to see as much machinectl support, as possible. We would probably need to work with systemd guys on clarifying which commands will not work with docker containers. machinectl status, show, list, terminate, kill

Might be interesting getting copy-to and copy-from to work.

machinectl login, poweroff, reboot might work if the --init=systemd patch was accepted.

@rhatdan
Copy link
Contributor Author

rhatdan commented Jun 27, 2015

My biggest goal with this is just to get

journalctl -M CONTAINERID

To work in the situation where journald is running within the container.

@icecrime
Copy link
Contributor

Just making sure here: the rest of machinectl/Docker integration will be done in the machinectl codebase? It just needs the initial information that the container exists, right?

return err
}

obj := conn.Object("org.freedesktop.machine1", "/org/freedesktop/machine1")
Copy link
Contributor

Choose a reason for hiding this comment

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

should machine1 be hardcoded like that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the API. There is no machine2...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cgwalters Do you agree?

@rhatdan
Copy link
Contributor Author

rhatdan commented Jul 13, 2015

Right now we have a race condition with this. If a container exits before RegisterMachine gets called, it will log a message. I can add a patch to search for the Container PID on error and just ignore the error. In a perfect world we could prevent the container PID from disappearing until after the RegisterMachine completes.

Also should we move this code to runc rather then having it in the docker daemon at all.

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jul 16, 2015
@cpuguy83
Copy link
Member

I'd like to see registerMachine and terminateMachine behind an interface.
I could see wanting to be able to register containers with more than just systemd.

@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jul 17, 2015
@rhatdan
Copy link
Contributor Author

rhatdan commented Jul 17, 2015

@cpuguy83 Added a machine interface, with linux and non linux. If someone adds another machine/container registration, then we could look at adding a buildtag for selinux

@LK4D4
Copy link
Contributor

LK4D4 commented Jul 23, 2015

@rhatdan I was pretty upset when machinectl terminate NAME killed my X server. So, I dunno what to say about design :)

@rhatdan
Copy link
Contributor Author

rhatdan commented Jul 23, 2015

@LK4D4 It is a feature. You needed to get a way from the keyboard for a few minutes.

@jessfraz
Copy link
Contributor

hahahahahaha

On Thu, Jul 23, 2015 at 1:55 PM, Daniel J Walsh notifications@github.com
wrote:

@LK4D4 https://github.com/LK4D4 It is a feature. You needed to get a
way from the keyboard for a few minutes.


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

@vbatts
Copy link
Contributor

vbatts commented Jul 23, 2015

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jul 24, 2015
Signed-off-by: Sally O'Malley <somalley@redhat.com>

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jul 24, 2015
@LK4D4
Copy link
Contributor

LK4D4 commented Aug 14, 2015

So, this stuff is working somehow. But I think this is malicious code because of systemd bugs(killing not what it supposing to kill). So if include it at all in current design, then only in experimental branch.
ping @docker/core-maintainers

@rhatdan
Copy link
Contributor Author

rhatdan commented Aug 14, 2015

We are looking at moving this code into runc pre/post scripts rather then docker.
That way we could eliminate the race condition, where the container exits before it is registered.

@LK4D4
Copy link
Contributor

LK4D4 commented Aug 14, 2015

@rhatdan As I see current PR makes no sense, because it only extends go systemd API. Maybe you should propose this changes to coreos/go-systemd first and then when we'll have pre/post scripts you will open PR with real implementation. Maybe systemd will be more generous to my X servers that time.

@rhatdan
Copy link
Contributor Author

rhatdan commented Aug 14, 2015

@LK4D4 Actually the calls have been lost from the patch. I sent patches for RegisterMachine/TerminateMachine to coreos a while ago, The current patch does not need some of the hire level stuff coreos version of systemd did.

I am going to close this and rework it for runc hooks, if and when this gets merged.

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

Successfully merging this pull request may close these issues.

None yet

7 participants