Commit Graph

292 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e7e9b6bb0b machinectl: make sure we are not reading an unitialized variable 2014-07-18 21:44:58 -04:00
Lennart Poettering 0dd25fb9f0 change type for address family to "int"
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this.
2014-07-18 16:10:51 +02:00
Lennart Poettering f48e75cb9a machinectl: show network interface name for containers
Also, append the if indexes as scope field to the addresses we show.
That way they may be used for connecting to the containers directly.
2014-07-10 23:12:32 +02:00
Lennart Poettering 717603e391 machinectl: show /etc/os-release information of container in status output 2014-07-03 17:54:24 +02:00
Lennart Poettering 878cd7e95c machined: add logic to query IP addresses of containers 2014-05-18 20:52:49 +09:00
Lennart Poettering 3d94f76c99 util: replace close_pipe() with new safe_close_pair()
safe_close_pair() is more like safe_close(), except that it handles
pairs of fds, and doesn't make and misleading allusion, as it works
similarly well for socketpairs() as for pipe()s...
2014-03-24 03:22:44 +01:00
Lennart Poettering 03e334a1c7 util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:

        fd = safe_close(fd);

Which will close an fd if it is open, and reset the fd variable
correctly.

By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards.
2014-03-18 19:31:34 +01:00
Lennart Poettering 1dba654b27 machinectl: reimplement machinectl's "reboot" verb on top of "kill", and add new verb "poweroff"
There's really no point to send the reboot SIGINT from machinectl
directly, if machined can do that anyway. This saves code, and
makes machinectl network transparent for these verbs. And while we are
at it we can easily add a "poweroff" verb in addition to "reboot". Yay!
2014-03-18 04:48:26 +01:00
Jason A. Donenfeld 3db729cb8e sd-bus: the bus returned should be the first arg
This matches the API of previous headers, such as sd-journal.h.
2014-02-20 00:03:09 +01:00
Thomas Hindoe Paaboel Andersen 6bebb0add4 machinectl: remove unused --no-ask-password 2014-02-18 21:14:40 +01:00
Thomas Hindoe Paaboel Andersen e56056e93d machinectl: add bash completion 2014-02-18 21:14:30 +01:00
Lennart Poettering 923d8fd381 machinectl: add new "machinectl reboot" call 2014-02-12 02:11:00 +01:00
Lennart Poettering 89f7c8465c machined: optionally, allow registration of pre-existing units (scopes
or services) as machine with machined
2014-02-11 17:16:08 +01:00
Lennart Poettering 6261f11fc3 machinectl: fix success check when getting pty from within container 2013-12-23 20:25:57 +01:00
Lennart Poettering fbadf04511 bus: when getting a kdbus connection into a container wait first for child, then read message
There's no EOF generated for AF_UNIX/SOCK_DGRAM sockets, hence let's
wait for the child first to see if it succeeded, only then read the socket.
2013-12-23 19:10:11 +01:00
Djalal Harouni 8c841f21f5 machinectl: show_properties() already logs the error 2013-12-18 23:58:23 -05:00
Lennart Poettering a4475f577b bus: when entering an existing namespace to connect to a container's system bus also switch over PID namespace
This is necessary to ensure that kdbus can collect creds of the
destination namespace when connecting.
2013-12-17 01:05:37 +01:00
Lennart Poettering bc9fd78c7b bus: when connecting to a container's kdbus instance, enter namespace first
Previously we'd open the connection in the originating namespace, which
meant most peers of the bus would not be able to make sense of the
PID/UID/... identity of us since we didn't exist in the namespace they
run in. However they require this identity for privilege decisions,
hence disallowing access to anything from the host.

Instead, when connecting to a container, create a temporary subprocess,
make it join the container's namespace and then connect from there to
the kdbus instance. This is similar to how we do it for socket
conections already.

THis also unifies the namespacing code used by machinectl and the bus
APIs.
2013-12-14 05:10:25 +01:00
Zbigniew Jędrzejewski-Szmek 4f8f66cb42 Help output spring cleaning
Use [brackets] only for optional elements.
Use <optional> in XML sources.
2013-12-08 19:26:51 -05:00
Lennart Poettering 613b411c94 service: add the ability for units to join other unit's PrivateNetwork= and PrivateTmp= namespaces 2013-11-27 20:28:48 +01:00
Lennart Poettering a6c616024d machinectl: close bus to container early 2013-11-08 14:07:26 +01:00
Lennart Poettering 74c7b1ed05 machinectl: show list headers even if we pipe, since that appears to be the usual way 2013-11-07 21:28:15 +01:00
Lennart Poettering 5b30bef856 bus: log message parsing errors everywhere with a generalized bus_log_parse_error() 2013-11-07 21:26:31 +01:00
Lennart Poettering 46e65dcc3a polkit: don't spawn local client if we access a remote system 2013-11-07 21:06:44 +01:00
Simon Peeters 27e72d6b22 bus: make bus_print_all_properties work for non machinectl cases
add a destination parameter and skip properties we can't read
2013-11-07 14:18:35 +01:00
Lennart Poettering 8bdbb8d9cb machinectl: we need glibc's socket.h, not our own 2013-11-07 00:53:19 +01:00
Zbigniew Jędrzejewski-Szmek 34a6778fb9 machinectl: use initialization instead of zeroing 2013-11-06 14:56:47 -05:00
Lennart Poettering eb9da376d7 clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts.
2013-11-06 18:28:39 +01:00
Lennart Poettering 84f6181c2a clients: various simplifications 2013-11-06 17:32:51 +01:00
Kay Sievers 9f6eb1cd58 bus: update bus_map_all_properties() 2013-11-05 02:57:49 +01:00
Thomas Hindoe Paaboel Andersen f69157a66f machinectl: fix warning when compiling with -Og
src/machine/machinectl.c: In function ‘openpt_in_namespace’:
src/machine/machinectl.c:623:44: warning: ‘master’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         close_nointr_nofail(master);
                                            ^
2013-11-01 20:54:29 +01:00
Lennart Poettering 04d3927924 machinectl: add new command to spawn a getty inside a container 2013-10-31 01:43:38 +01:00
Lennart Poettering d21ed1ead1 run: add support for executing commands remotely via SSH or in a container
Also, unify the transport logic a bit, since we reuse the same scheme in
many of our client tools.
2013-10-30 16:44:55 +01:00
Lennart Poettering 53755121e1 machinectl: we don't really just show information, we execute operations 2013-10-30 15:42:06 +01:00
Lennart Poettering a7893c6b28 bus: add API call to create bus connection to the system bus of local containers
Also, add support for this to machinectl, so that we can enumerate the
machines that run inside a container. We must go deeper!
2013-10-30 15:37:02 +01:00
Lennart Poettering 0f8bd8debb bus: move ssh support into public API of libsystem-bus 2013-10-30 15:35:49 +01:00
Marc-Antoine Perennou 415e7f65db machinectl: privileged option is gone 2013-10-30 15:35:59 +01:00
Tom Gundersen a1da85830b machinectl: port to sd-bus 2013-10-30 03:40:23 +01:00
Lennart Poettering 9d12709626 loginctl: suppress cgroup tree output if cgroup is empty
same for machinectl
2013-07-11 19:14:38 +02:00
Lennart Poettering aa1936ea1a loginctl: restore cgroup display for status output
Same for machinectl.
2013-07-11 00:32:32 +02:00
Zbigniew Jędrzejewski-Szmek 19887cd06a man: document machinectl and systemd-machined 2013-07-06 22:23:31 -04:00
Lennart Poettering 1ee306e124 machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl.
2013-07-02 03:47:23 +02:00