202 Commits

Author SHA1 Message Date
79aeed9681 rootless: cherry-pick runtime from the system configuration
when creating the default libpod.conf file, be sure the default OCI
runtime is cherry picked from the system configuration.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-12 14:19:59 +02:00
e2e41a7003 Add conmon probe to runtime construction
Now, when a user's conmon is out of date, podman will tell them

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-08 20:24:19 -04:00
37b40e9acd Merge pull request #3466 from TomSweeneyRedHat/dev/tsweeney/myhome
Touch up XDG, add rootless links
2019-08-06 17:42:54 +02:00
577b37b716 honor libpod.conf in /usr/share/containers
we should be looking for the libpod.conf file in /usr/share/containers
and not in /usr/local.  packages of podman should drop the default
libpod.conf in /usr/share.  the override remains /etc/containers/ as
well.

Fixes: #3702

Signed-off-by: baude <bbaude@redhat.com>
2019-08-04 14:04:18 -05:00
7dfaef7766 Add runtime and conmon path discovery
The `$PATH` environment variable will now used as fallback if no valid
runtime or conmon path matches. The debug logs has been updated to state
the used executable.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-08-01 08:32:25 +02:00
52ae51c79f Update libpod.conf to be NixOS friendly
NixOS links the current system state to `/run/current-system`, so we
have to add these paths to the configuration files as well to work out
of the box.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-30 12:59:11 +02:00
5779e89809 Touch up XDG, add rootless links
Touch up a number of formating issues for XDG_RUNTIME_DIRS in a number
of man pages.  Make use of the XDG_CONFIG_HOME environment variable
in a rootless environment if available, or set it if not.

Also added a number of links to the Rootless Podman config page and
added the location of the auth.json files to that doc.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-07-29 11:29:41 -04:00
5fb4feb36a Fix a segfault on Podman no-store commands with refresh
When a command (like `ps`) requests no store be created, but also
requires a refresh be performed, we have to ignore its request
and initialize the store anyways to prevent segfaults. This work
was done in #3532, but that missed one thing - initializing a
storage service. Without the storage service, Podman will still
segfault. Fix that oversight here.

Fixes #3625

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-07-23 13:30:30 -04:00
547cb4e55e Merge pull request #3532 from mheon/ensure_store_on_refresh
Ensure we have a valid store when we refresh
2019-07-15 21:26:16 +02:00
e053e0e05e first pass of corrections for golangci-lint
Signed-off-by: baude <bbaude@redhat.com>
2019-07-10 15:52:17 -05:00
5ef972d87b Ensure we have a valid store when we refresh
Fixes #3520

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-10 08:55:48 -04:00
1d36501f96 code cleanup
clean up code identified as problematic by golands inspection

Signed-off-by: baude <bbaude@redhat.com>
2019-07-08 09:18:11 -05:00
a22a32a0a5 Merge pull request #3437 from giuseppe/fix-nocgo
build: allow to build without cgo on RISC-V
2019-07-03 15:58:26 +02:00
827ac0859f lock: new lock type "file"
it is a wrapper around containers/storage file locking.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-02 16:41:10 +02:00
82164a2e9e runtime: allow to specify the lock mechanism
preparation for the next patch.  It currently supports only "shm".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-02 16:41:10 +02:00
d0a0a3fbd9 configure runtime without store
some podman commands do not require the use of a container/image store.
in those cases, it is more effecient to not open the store, because that
results in having to also close the store which can be costly when the
system is under heavy write I/O loads.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-01 14:15:44 -05:00
150778820f Merge pull request #3324 from marcov/detach-keys-configurable
libpod: specify a detach keys sequence in libpod.conf
2019-07-01 15:54:27 +02:00
7255468e65 rootless: enable linger if /run/user/UID not exists
at least on Fedora 30 it creates the /run/user/UID directory for the
user logged in via ssh.

This needs to be done very early so that every other check when we
create the default configuration file will point to the correct
location.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-27 16:34:35 +02:00
0906b32087 Merge pull request #3442 from baude/removelibpodfrommainphase2
libpod removal from main (phase 2)
2019-06-27 16:01:45 +02:00
8561b99644 libpod removal from main (phase 2)
this is phase 2 for the removal of libpod from main.

Signed-off-by: baude <bbaude@redhat.com>
2019-06-27 07:56:24 -05:00
7e3c27eb9d runtime: do not attempt to use global conf file
we had a regression where the rootless user tried to use the global
configuration file.  We should not try to use the global configuration
when running in rootless but only cherry-pick some settings from there
when creating the file for the first time.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-27 14:22:51 +02:00
bfcf0292de runtime: use GetRootlessUID() to get rootless uid
otherwise it won't work in a user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-27 13:52:36 +02:00
7705f99fe6 Merge pull request #3429 from cevich/strip_crio_conmon
Remove refs to crio/conmon
2019-06-27 03:05:33 +02:00
fc32439c29 Remove refs to crio/conmon
Conmon has moved out of cri-o and into it's own dedicated repository.
This commit updates configuration and definitions which referenced
the old cri-o based paths.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-06-26 12:44:22 -04:00
7e3f1c21b0 libpod: specify a detach keys sequence in libpod.conf
Add the ability of specifying a detach keys sequence in libpod.conf

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-26 10:12:34 +02:00
c9078936dd Merge pull request #3419 from baude/removelibpodfrommainphase1
remove libpod from main
2019-06-26 02:36:06 +02:00
dd81a44ccf remove libpod from main
the compilation demands of having libpod in main is a burden for the
remote client compilations.  to combat this, we should move the use of
libpod structs, vars, constants, and functions into the adapter code
where it will only be compiled by the local client.

this should result in cleaner code organization and smaller binaries. it
should also help if we ever need to compile the remote client on
non-Linux operating systems natively (not cross-compiled).

Signed-off-by: baude <bbaude@redhat.com>
2019-06-25 13:51:24 -05:00
21978c9908 Merge pull request #3332 from rhatdan/cgroupmanager
Correctly identify the defaults for cgroup-manager
2019-06-25 14:54:28 +02:00
e2b0587c21 runtime.go: Add /usr/local/{s,}bin
Signed-off-by: Jamie Bliss <jamie@ivyleav.es>
2019-06-21 14:38:29 -04:00
7377870641 Properly handle OCI runtime being set to a path
This is done by the --runtime flag, and as such, by all our CI.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-20 15:07:46 -04:00
fa0e48f21a Make a missing OCI runtime nonfatal
We may want to ship configurations including more than one
runtime configuration - for example, crun and runc and kata, all
configured. However, we don't want to make these extra runtimes
hard requirements, so let's not fatally error when we can't find
their executables.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-19 17:14:15 -04:00
92bae8d308 Begin adding support for multiple OCI runtimes
Allow Podman containers to request to use a specific OCI runtime
if multiple runtimes are configured. This is the first step to
properly supporting containers in a multi-runtime environment.

The biggest changes are that all OCI runtimes are now initialized
when Podman creates its runtime, and containers now use the
runtime requested in their configuration (instead of always the
default runtime).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-19 17:08:43 -04:00
53c3720de9 Correctly identify the defaults for cgroup-manager
Currently we report cgroupmanager default as systemd, even if the user modified
the libpod.conf.  Also cgroupmanager does not work in rootless mode.  This
PR correctly identifies the default cgroup manager or reports it is not supported.

Also add homeDir to correctly get the homedir if the $HOME is not set.  Will
attempt to get Homedir out of /etc/passwd.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-06-15 09:51:47 -04:00
7baa6b6266 Remove unnecessary var type to fix lint warning
Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-06-14 17:42:05 -05:00
373048aaca Move installPrefix and etcDir into runtime.go
Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-06-14 17:42:05 -05:00
6ea12e3028 Improve DESTDIR/PREFIX/ETCDIR handling
- PREFIX is now passed saved in the binary at build-time so that default
  paths match installation paths.
- ETCDIR is also overridable in a similar way.
- DESTDIR is now applied on top of PREFIX for install/uninstall steps.
  Previously, a DESTDIR=/foo PREFIX=/bar make would install into /bar,
  rather than /foo/bar.

Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-06-14 17:42:05 -05:00
13e1afdb02 oci: allow to specify what runtimes support JSON
add a new configuration `runtime_supports_json` to list what OCI
runtimes support the --log-format=json option.  If the runtime is not
listed here, libpod will redirect stdout/stderr from the runtime
process.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-13 14:21:13 +02:00
8fe22d48fb Inherit rootless init_path from system libpod.conf
Signed-off-by: Lawrence Chan <element103@gmail.com>
2019-06-03 18:44:36 -05:00
6ddf47ca38 runtime: unlock the alive lock only once
Unlock the alive lock only once in the deferred func call.

Fixes: #3207
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-05-28 15:54:26 +02:00
791d53a214 rootless: use a pause process
use a pause process to keep the user and mount namespace alive.

The pause process is created immediately on reload, and all successive
Podman processes will refer to it for joining the user&mount
namespace.

This solves all the race conditions we had on joining the correct
namespaces using the conmon processes.

As a fallback if the join fails for any reason (e.g. the pause process
was killed), then we try to join the running containers as we were
doing before.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-05-17 20:48:24 +02:00
2e0fef51b3 migrate: not create a new namespace
this leaves the containers stopped but we won't risk to use the wrong
user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-05-17 20:47:55 +02:00
7a58c6601b set default event logger based on build tags
once the default event logger was removed from libpod.conf, we need to
set the default based on whether the systemd build tag is used or not.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-14 16:17:11 -05:00
bc7b1ca03d enable integration tests for remote-client
first pass at enabling a swath of integration tests for the
remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-07 14:06:02 -05:00
d1a7378aa0 change from sysregistries to sysregistriesv2
We want to start supporting the registries.conf format.
Also start showing blocked registries in podman info
Fix sorting so all registries are listed together in podman info.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-03 10:38:51 -04:00
416cc20c68 Small fixes for #2950
We merged #2950 with some nits still remaining, as Giuseppe was
going on PTO. This addresses those small requested changes.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-01 15:07:30 -04:00
f49e0c19ed runtime: pass down the context
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-26 22:23:49 +02:00
525f0b30ac system: add new subcommand "migrate"
it is useful to migrate existing containers to a new version of
podman.  Currently, it is needed to migrate rootless containers that
were created with podman <= 1.2 to a newer version which requires all
containers to be running in the same user namespace.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-26 22:23:45 +02:00
04d6ff0582 Add System event type and renumber, refresh events
Also, re-add locking to file eventer Write() to protect against
concurrent events.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-25 16:23:09 -04:00
a01c62fcbd Merge pull request #3013 from mheon/logging_for_refresh
Logging for refresh
2019-04-25 12:43:43 -07:00
0df9f6f9fe Add a debug message indicating that a refresh occurred
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-25 11:29:16 -04:00