[systemd-devel] systemd services via SSH (-H key)

Lennart Poettering lennart at poettering.net
Fri Oct 23 04:04:54 PDT 2015


On Fri, 23.10.15 09:07, Stuart Longland (stuartl at longlandclan.id.au) wrote:

> On 23/10/15 08:59, Reindl Harald wrote:
> >> Because the syntax of -H parameter is "[user@]host[:container]"
> >> and it does not allow specifying an explicit port number.
> > 
> > [user@]host[:container][:port]
> > [user@]host[:port][:container]
> 
> Can a container name be all-numeric?

We make the same restrictions on container names as on host names. And
that means all-numeric is OK.

> Who made the decision to use ':'?  Any particular reason?

I did.

The ultimate goal is that I wanted a way to reference units in the
network, by specifying a path to them. I.e. something like:

   foo:bar:baz/apache.service

Should refer to the "apache.service" unit in container "baz", that
runs inside container "bar" on host "foo"...

With that command lines like the following should work:

   systemctl start foo:bar:baz/apache.service
   systemctl stop foo:bar:baz/apache.service
   systemctl status foo:bar:baz/apache.service

(and in case we want to access a service running in a local container
the syntax would be:

  systemctl start :quux:waldo/mysql.service

which would mean the mysql service running on container waldo, which
runs in cotnainer quux on the local host)

But, as things go, this is just something I always wanted to support,
but never actually worked on to deliver. Parts of it are implemented
though, such as the "-H foo:bar" thing, or the "-M bar" thing... But
taking it all the way is a bit more work.

Again, if you use non-standard parameters for accessing remote ssh
services, my recommendation would be to configure them in
~/.ssh/config, and that's not just the port number, but everything
else too, like cyphers, the username, ...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list