diff --git a/lxd.changes b/lxd.changes index faab45f..17096a0 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 8 13:18:50 UTC 2019 - Jan Engelhardt + +- %pre bash features: replace by POSIX equivalents. +- %build bash features: add %_buildshell definition for it. +- Do not igonre errors from groupadd. + ------------------------------------------------------------------- Fri Apr 5 19:13:48 UTC 2019 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 3288f43..da8ca27 100644 --- a/lxd.spec +++ b/lxd.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%define _buildshell /bin/bash %define import_path github.com/lxc/lxd Name: lxd @@ -240,12 +241,12 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} %pre # Group which owns the lxd socket, which allows people to administer it. -getent group %{name} &>/dev/null || groupadd -r %{name} ||: +getent group %{name} >/dev/null || groupadd -r %{name} # /etc/sub[ug]id should exist already (it's part of shadow-utils), but older # distros don't have it. LXD just parses it and doesn't need any special # shadow-utils helpers. -touch /etc/sub{u,g}id ||: +touch /etc/subuid /etc/subgid || : # Add sub[ug]ids for LXD's unprivileged containers -- in order to support # isolated containers we add quite a few subuids. Since LXD runs as root we add @@ -260,9 +261,9 @@ touch /etc/sub{u,g}id ||: # # This default setting of 500 million is enough for ~8000 isolated containers, # which should be enough for most users. -grep '^root:' /etc/subuid &>/dev/null || \ +grep -q '^root:' /etc/subuid 2>/dev/null || \ usermod -v 400000000-900000000 root ||: -grep '^root:' /etc/subgid &>/dev/null || \ +grep -q '^root:' /etc/subgid 2>/dev/null || \ usermod -w 400000000-900000000 root ||: %service_add_pre %{name}.service