summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-09 05:03:24 -0800
committerGitHub <noreply@github.com>2019-03-09 05:03:24 -0800
commit68a984a9376d6258913ae130d52d6037339e87bf (patch)
treeca5aa8f7d29b9beb7b961fd26c5e449dc0e6eaa9
parentb15273a0ca76fcbfb13c3baa794790489da137b4 (diff)
parent550f9b1f6f0311034fbc265257e196dfc9e52b61 (diff)
downloadpodman-68a984a9376d6258913ae130d52d6037339e87bf.tar.gz
podman-68a984a9376d6258913ae130d52d6037339e87bf.tar.bz2
podman-68a984a9376d6258913ae130d52d6037339e87bf.zip
Merge pull request #2576 from rhatdan/troubleshooting
Add troublshoot information about SELinux labeling of containers/storage
-rw-r--r--troubleshooting.md39
1 files changed, 39 insertions, 0 deletions
diff --git a/troubleshooting.md b/troubleshooting.md
index 24a1dc6cb..33434cdbb 100644
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -254,3 +254,42 @@ grep johndoe /etc/subuid /etc/subgid
/etc/subuid:johndoe:200000:1001
/etc/subgid:johndoe:200000:1001
```
+
+### 11) Changing the location of the Graphroot leads to permission denied
+
+When I change the graphroot storage location in storage.conf, the next time I
+run podman I get an error like:
+
+```
+# podman run -p 5000:5000 -it centos bash
+
+bash: error while loading shared libraries: /lib64/libc.so.6: cannot apply additional memory protection after relocation: Permission denied
+```
+
+For example, the admin sets up a spare disk to be mounted at `/src/containers`,
+and points storage.conf at this directory.
+
+
+#### Symptom
+
+SELinux blocks containers from using random locations for overlay storage.
+These directories need to be labeled with the same labels as if the content was
+under /var/lib/containers/storage.
+
+#### Solution
+
+Tell SELinux about the new containers storage by setting up an equivalence record.
+This tells SELinux to label content under the new path, as if it was stored
+under `/var/lib/containers/storage`.
+
+```
+semanage fcontext -a -e /var/lib/containers /srv/containers
+restorecon -R -v /src/containers
+```
+
+The semanage command above tells SELinux to setup the default labeling of
+`/srv/containers` to match `/var/lib/containers`. The `restorecon` command
+tells SELinux to apply the labels to the actual content.
+
+Now all new content created in these directories will automatically be created
+with the correct label.