summaryrefslogtreecommitdiff
path: root/src/machine/machinectl.c
AgeCommit message (Collapse)Author
2015-01-02machinectl: Check type instead of path before printing the typeThomas Hindoe Paaboel Andersen
Looks like a typo when introduced in fefdc04b38725457a91651218feb7000f6ccc1f4
2014-12-31machinectl: remove dead codeDavid Herrmann
'r' is not touched after the previous error-checking 100 lines above. Drop that code.
2014-12-29machinectl: add "enable" and "disable" verbs for enabling/disabling ↵Lennart Poettering
systemd-nspawn for containers This is basically just a shortcut for "systemctl enable systemd-nspawn@<foobar>.service", but does escaping.
2014-12-29machinectl: add new "start" verb to start a container as a service in nspawnLennart Poettering
2014-12-28machined: add support for reporting image size via btrfs quotaLennart Poettering
2014-12-28machinectl/machined: implement "rename", "clone", "read-only" verbs for ↵Lennart Poettering
machine images
2014-12-28machined: add "machinectl remove" for removing imagesLennart Poettering
2014-12-26machinectl: add status commandsLennart Poettering
2014-12-26machinectl: mark read-only images when listing in redLennart Poettering
2014-12-26machinectl: left-align timesLennart Poettering
2014-12-25machined: beef up machined image listing with creation/modification times of ↵Lennart Poettering
subvolumes We make use of the btrfs subvol crtime for this, and for gpt images of a manually managed xattr, if we can.
2014-12-24sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering
Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
2014-12-23machined: introduce polkit for OpenLogin() callLennart Poettering
This way "machinectl login" can be opened up to run without privileges.
2014-12-23machinectl: rework 'machinectl login' to use OpenMachineLogin()Lennart Poettering
2014-12-23systemd-run: support -t mode when combined with -MLennart Poettering
For that, ask machined for a container PTY and use that.
2014-12-23machined: add OpenMachinePTY() bus call for allocating a PTY device within a ↵Lennart Poettering
container Then, port "machinectl" over to make use of it.
2014-12-23machinectl,nspawn: don't print extra final newline if pty terminal output ↵Lennart Poettering
was newline-terinated anyway
2014-12-23run: add a new "-t" mode for invoking a binary on an allocated TTYLennart Poettering
2014-12-19machinectl: port machinectl to new verbs logicLennart Poettering
2014-12-19machined/machinectl: add logic to show list of available imagesLennart Poettering
This adds a new bus call to machined that enumerates /var/lib/container and returns all trees stored in it, distuingishing three types: - GPT disk images, which are files suffixed with ".gpt" - directory trees - btrfs subvolumes
2014-12-18machinectl: add new commands for copying files from/to containersLennart Poettering
2014-12-18machinectl: implement "bind" command to create additional bind mounts from ↵Lennart Poettering
host to container during runtime
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-10-31ptyforward: rework PTY forwarder logic used by nspawn to utilize the normal ↵Lennart Poettering
event loop We really should not run manual event loops anymore, but standardize on sd_event, so that we can run sd_bus connections from it eventually.
2014-08-04bus: always explicitly close bus from main programsLennart Poettering
Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek
getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
2014-07-18machinectl: make sure we are not reading an unitialized variableZbigniew Jędrzejewski-Szmek
2014-07-18change type for address family to "int"Lennart Poettering
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-10machinectl: show network interface name for containersLennart Poettering
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-03machinectl: show /etc/os-release information of container in status outputLennart Poettering
2014-05-18machined: add logic to query IP addresses of containersLennart Poettering
2014-03-24util: replace close_pipe() with new safe_close_pair()Lennart Poettering
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-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
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-18machinectl: reimplement machinectl's "reboot" verb on top of "kill", and add ↵Lennart Poettering
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-02-20sd-bus: the bus returned should be the first argJason A. Donenfeld
This matches the API of previous headers, such as sd-journal.h.
2014-02-18machinectl: remove unused --no-ask-passwordThomas Hindoe Paaboel Andersen
2014-02-18machinectl: add bash completionThomas Hindoe Paaboel Andersen
2014-02-12machinectl: add new "machinectl reboot" callLennart Poettering
2014-02-11machined: optionally, allow registration of pre-existing units (scopesLennart Poettering
or services) as machine with machined
2013-12-23machinectl: fix success check when getting pty from within containerLennart Poettering
2013-12-23bus: when getting a kdbus connection into a container wait first for child, ↵Lennart Poettering
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-18machinectl: show_properties() already logs the errorDjalal Harouni
2013-12-17bus: when entering an existing namespace to connect to a container's system ↵Lennart Poettering
bus also switch over PID namespace This is necessary to ensure that kdbus can collect creds of the destination namespace when connecting.
2013-12-14bus: when connecting to a container's kdbus instance, enter namespace firstLennart Poettering
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-08Help output spring cleaningZbigniew Jędrzejewski-Szmek
Use [brackets] only for optional elements. Use <optional> in XML sources.
2013-11-27service: add the ability for units to join other unit's PrivateNetwork= and ↵Lennart Poettering
PrivateTmp= namespaces