* Revert r18985, but now handle the case where a nixbld user doesn't
exist yet. Ludo's original patch only worked in the "update" case. Also, do this only for the nixbld group. svn path=/nixos/trunk/; revision=18990
This commit is contained in:
parent
5bf9fdbe41
commit
0d095de38a
@ -32,8 +32,8 @@ let
|
|||||||
calls in `libstore/build.cc', don't add any supplementary group
|
calls in `libstore/build.cc', don't add any supplementary group
|
||||||
here. */
|
here. */
|
||||||
uid = builtins.add ids.uids.nixbld nr;
|
uid = builtins.add ids.uids.nixbld nr;
|
||||||
group = "nogroup";
|
group = "nixbld";
|
||||||
extraGroups = ["nixbld"];
|
extraGroups = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixBuildUsers = map makeNixBuildUser (pkgs.lib.range 1 10);
|
nixBuildUsers = map makeNixBuildUser (pkgs.lib.range 1 10);
|
||||||
@ -169,6 +169,8 @@ in
|
|||||||
|
|
||||||
system.activationScripts.users = fullDepEntry
|
system.activationScripts.users = fullDepEntry
|
||||||
''
|
''
|
||||||
|
echo "updating users..."
|
||||||
|
|
||||||
cat ${usersFile} | while true; do
|
cat ${usersFile} | while true; do
|
||||||
read name || break
|
read name || break
|
||||||
read description
|
read description
|
||||||
@ -181,7 +183,6 @@ in
|
|||||||
read password
|
read password
|
||||||
|
|
||||||
if ! curEnt=$(getent passwd "$name"); then
|
if ! curEnt=$(getent passwd "$name"); then
|
||||||
echo "creating user $name..."
|
|
||||||
useradd --system \
|
useradd --system \
|
||||||
"$name" \
|
"$name" \
|
||||||
--comment "$description" \
|
--comment "$description" \
|
||||||
@ -215,17 +216,27 @@ in
|
|||||||
--shell "$shell"
|
--shell "$shell"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$group" = nixbld; then
|
||||||
|
# As a special hack, add users that have nixbld as the
|
||||||
|
# primary group to the /etc/group entry for the nixbld
|
||||||
|
# group. `nix-store' currently expects this in order
|
||||||
|
# to get the UIDs of all the build users by doing a
|
||||||
|
# getprnam("nixbld") call.
|
||||||
|
groupmod "$group" -A "$name"
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
'' [ "groups" ];
|
'' [ "groups" ];
|
||||||
|
|
||||||
system.activationScripts.groups = fullDepEntry
|
system.activationScripts.groups = fullDepEntry
|
||||||
''
|
''
|
||||||
|
echo "updating groups..."
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read name || break
|
read name || break
|
||||||
read gid
|
read gid
|
||||||
|
|
||||||
if ! curEnt=$(getent group "$name"); then
|
if ! curEnt=$(getent group "$name"); then
|
||||||
echo "creating group $name..."
|
|
||||||
groupadd --system \
|
groupadd --system \
|
||||||
"$name" \
|
"$name" \
|
||||||
''${gid:+--gid $gid}
|
''${gid:+--gid $gid}
|
||||||
|
Loading…
Reference in New Issue
Block a user