Skip to content

Have docker register its machine with systemd - #13526

Closed
rhatdan wants to merge 1 commit into
moby:masterfrom
rhatdan:registermachine
Closed

rhatdan wants to merge 1 commit into
moby:masterfrom
rhatdan:registermachine

Conversation

@rhatdan

@rhatdan rhatdan commented May 28, 2015

Copy link
Copy Markdown
Contributor

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 [email protected] (github: rhatdan)

@rhatdan

rhatdan commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

Crickets? @jfrazelle @crosbymichael @tianon

@icecrime

Copy link
Copy Markdown
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

rhatdan commented Jun 27, 2015

Copy link
Copy Markdown
Contributor Author

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

rhatdan commented Jun 27, 2015

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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?

Comment thread pkg/systemd/register.go

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

rhatdan commented Jul 13, 2015

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

rhatdan commented Jul 17, 2015

Copy link
Copy Markdown
Contributor Author

@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

LK4D4 commented Jul 23, 2015

Copy link
Copy Markdown
Contributor

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

@rhatdan

rhatdan commented Jul 23, 2015

Copy link
Copy Markdown
Contributor Author

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

@jessfraz

Copy link
Copy Markdown
Contributor

hahahahahaha

On Thu, Jul 23, 2015 at 1:55 PM, Daniel J Walsh [email protected]
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

vbatts commented Jul 23, 2015

Copy link
Copy Markdown
Contributor

@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 <[email protected]>

Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (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

LK4D4 commented Aug 14, 2015

Copy link
Copy Markdown
Contributor

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

rhatdan commented Aug 14, 2015

Copy link
Copy Markdown
Contributor Author

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

LK4D4 commented Aug 14, 2015

Copy link
Copy Markdown
Contributor

@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

rhatdan commented Aug 14, 2015

Copy link
Copy Markdown
Contributor Author

@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.

7 participants