From 1d0c730a6de4240cdb7b5ff655969e1f18657c50505d1b2867ccf89e839fad28 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 12 Dec 2019 00:12:45 +0000 Subject: [PATCH] Accepting request 755958 from home:cyphar:lxc - Support older SLE systems which don't have "usermod -w -v". OBS-URL: https://build.opensuse.org/request/show/755958 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=31 --- lxd.changes | 5 +++++ lxd.spec | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lxd.changes b/lxd.changes index f97aaf6..da2612f 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 11 23:55:40 UTC 2019 - Aleksa Sarai + +- Support older SLE systems which don't have "usermod -w -v". + ------------------------------------------------------------------- Thu Oct 3 01:53:53 UTC 2019 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 17c3447..f316a81 100644 --- a/lxd.spec +++ b/lxd.spec @@ -1,7 +1,7 @@ # # spec file for package lxd # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -326,9 +326,11 @@ touch /etc/subuid /etc/subgid ||: # This default setting of 500 million is enough for ~8000 isolated containers, # which should be enough for most users. grep -q '^root:' /etc/subuid || \ - usermod -v 400000000-900000000 root ||: + usermod -v 400000000-900000000 root &>/dev/null || \ + echo "root:400000000:500000001" >>/etc/subuid ||: grep -q '^root:' /etc/subgid || \ - usermod -w 400000000-900000000 root ||: + usermod -w 400000000-900000000 root &>/dev/null || \ + echo "root:400000000:500000001" >>/etc/subgid ||: %service_add_pre %{name}.service