17 Commits

Author SHA1 Message Date
9faa6456da networking: fix segfault when slirp4netns is missing
fixes a segfault when slirp4netns is not installed and the slirp sync
pipe is not created.

Closes: https://github.com/containers/libpod/issues/4113

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-01 08:51:57 +02:00
5813c8246e rootless: Rearrange setup of rootless containers
In order to run Podman with VM-based runtimes unprivileged, the
network must be set up prior to the container creation. Therefore
this commit modifies Podman to run rootless containers by:
  1. create a network namespace
  2. pass the netns persistent mount path to the slirp4netns
     to create the tap inferface
  3. pass the netns path to the OCI spec, so the runtime can
     enter the netns

Closes #2897

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-09-24 11:01:28 +02:00
497678d9e3 exec: set HOME also with exec sessions
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-21 22:11:10 +02:00
afd0818326 rootless: automatically create a systemd scope
when running in rootless mode and using systemd as cgroup manager
create automatically a systemd scope when the user doesn't own the
current cgroup.

This solves a couple of issues:

on cgroup v2 it is necessary that a process before it can moved to a
different cgroup tree must be in a directory owned by the unprivileged
user.  This is not always true, e.g. when creating a session with su
-l.

Closes: https://github.com/containers/libpod/issues/3937

Also, for running systemd in a container it was before necessary to
specify "systemd-run --scope --user podman ...", now this is done
automatically as part of this PR.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-12 08:35:26 +02:00
c2284962c7 Add support for launching containers without CGroups
This is mostly used with Systemd, which really wants to manage
CGroups itself when managing containers via unit file.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-10 10:52:37 -04:00
890378e3f7 Merge pull request #3760 from rhatdan/auth
Use GetRuntimeDir to setup auth.json for login
2019-08-19 21:16:06 +02:00
7421124919 libpod, pkg: lookup also for crun failures
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 11:11:37 +02:00
763d2d062d libpod: still attempt to read the oci log file if not output
if we didn't receive any data on the pipe, still attempt to read the
specified log file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-19 11:11:35 +02:00
e6673012b5 do not activate sd_notify support when varlink
add ability to not activate sd_notify when running under varlink as it
causes deadlocks and hangs.

Fixes: #3572

Signed-off-by: baude <bbaude@redhat.com>
2019-08-15 12:32:54 -05:00
d27e71374e Use GetRuntimeDir to setup auth.json for login
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-08-12 14:11:53 -04:00
1ef5c4ea8f oci: drop check for euid==0
we are always running with euid==0 at this point.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-12 11:58:18 +02:00
97b84dedf3 Revert "rootless: Rearrange setup of rootless containers"
This reverts commit 80dcd4bebcdc8e280f6b43228561d09c194c328b.

Signed-off-by: baude <bbaude@redhat.com>
2019-08-06 09:51:38 -05:00
e2f38cdaa4 Merge pull request #3310 from gabibeyer/rootlessKata
rootless: Rearrange setup of rootless containers ***CIRRUS: TEST IMAGES***
2019-08-05 14:26:04 +02:00
2110422a61 Add handling for empty LogDriver
There are two cases logdriver can be empty, if it wasn't set by libpod, or if the user did --log-driver ""
The latter case is an odd one, and the former is very possible and already handled for LogPath.
Instead of printing an error for an entirely reasonable codepath, let's supress the error

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-02 14:03:27 -04:00
80dcd4bebc rootless: Rearrange setup of rootless containers
In order to run Podman with VM-based runtimes unprivileged, the
network must be set up prior to the container creation. Therefore
this commit modifies Podman to run rootless containers by:
  1. create a network namespace
  2. pass the netns persistent mount path to the slirp4netns
     to create the tap inferface
  3. pass the netns path to the OCI spec, so the runtime can
     enter the netns

Closes #2897

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
2019-07-30 23:28:52 +00:00
a793bccae6 golangci-lint cleanup
a PR slipped through without running the new linter.  this cleans things
up for the master branch.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-23 10:13:04 -05:00
a1a79c08b7 Implement conmon exec
This includes:
	Implement exec -i and fix some typos in description of -i docs
	pass failed runtime status to caller
	Add resize handling for a terminal connection
	Customize exec systemd-cgroup slice
	fix healthcheck
	fix top
	add --detach-keys
	Implement podman-remote exec (jhonce)
	* Cleanup some orphaned code (jhonce)
	adapt remote exec for conmon exec (pehunt)
	Fix healthcheck and exec to match docs
		Introduce two new OCIRuntime errors to more comprehensively describe situations in which the runtime can error
		Use these different errors in branching for exit code in healthcheck and exec
	Set conmon to use new api version

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 15:57:23 -04:00