[systemd-devel] machinectl status vs show

Johannes Ernst johannes.ernst at gmail.com
Wed Jun 17 14:22:45 PDT 2015


> On Jun 17, 2015, at 14:09, Lennart Poettering <lennart at poettering.net> wrote:
> 
> On Wed, 17.06.15 13:34, Johannes Ernst (johannes.ernst at gmail.com) wrote:
> 
>> 2. So how do I get at the IP address of the container in a way that
>> is easily parseable?
> 
> make sure "nss-mymachines" is installed and enabled (see its man page
> for details). With that in place the container name is resolvable
> using normal libc calls, i.e. "ping <containername>" will work then,
> and all other commands too.
> 
> Use "getent hosts foobar" to resolve hostnames from the command line,
> in a generic, parsable way. It will then work both for containers as
> well as for any other kind of host name.

Duh. In hindsight, that’s sort of obvious, sorry for missing it.

[[Meta-comment: I’m finding that systemd is a rather amazing set of technologies, doing much more than is generally known. It’s all very nicely integrated, too, BUT: for somebody like me who doesn’t live on the inside of the project, it's not obvious how things fit together or are intended to be used, so they ask silly questions on the mailing list like I have been doing.

I wonder whether one of the Linux magazines would be interested in doing a “following systemd” kind of regular piece in which they would go through one use case after another with full shell transcripts, depending on what’s new this month. Or does that exist already?]]

</musing out loud>

Thanks for the help,


Johannes.



More information about the systemd-devel mailing list