SPC - Cannot restart host operating from container (#1384523)

Resolves: #1384523
This commit is contained in:
Jan Synacek 2016-10-18 14:14:59 +02:00
parent 7ae71c8772
commit 14572d7192
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 08a28eeca70eeefb55af61191b63e4c938daca73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Sat, 15 Oct 2016 19:54:58 +0200
Subject: [PATCH] virt: add possibility to skip the check for chroot (#4374)
https://bugzilla.redhat.com/show_bug.cgi?id=1379852
---
src/basic/virt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 10a2043..41012d5 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -33,6 +33,7 @@
#include "string-table.h"
#include "string-util.h"
#include "virt.h"
+#include "env-util.h"
static int detect_vm_cpuid(void) {
@@ -487,6 +488,9 @@ int detect_virtualization(void) {
int running_in_chroot(void) {
int ret;
+ if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0)
+ return 0;
+
ret = files_same("/proc/1/root", "/");
if (ret < 0)
return ret;
--
2.7.4

View File

@ -12,7 +12,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 231
Release: 10%{?gitcommit:.git%{gitcommitshort}}%{?dist}
Release: 11%{?gitcommit:.git%{gitcommitshort}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -56,6 +56,7 @@ Patch0016: 0016-If-the-notification-message-length-is-0-ignore-the-m.patch
Patch0017: 0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch
Patch0018: 0018-pid1-process-zero-length-notification-messages-again.patch
Patch0019: 0019-shared-install-fix-set-default-with-empty-root-4118.patch
Patch0020: 0020-virt-add-possibility-to-skip-the-check-for-chroot-43.patch
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
@ -948,6 +949,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
%{_mandir}/man[1578]/systemd-nspawn.*
%changelog
* Tue Oct 18 2016 Jan Synáček <jsynacek@redhat.com> - 231-11
- SPC - Cannot restart host operating from container (#1384523)
* Sun Oct 9 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 231-10
- Do not recreate /var/log/journal on upgrades (#1383066)
- Move nss-myhostname provides to systemd-libs (#1383271)