activation: Only create groups that do not exist yet.

Before that the effect would be to re-create groups at each boot, and
thus remove any members of the groups.

* guix/build/activation.scm (activate-users+groups): Call 'add-group'
  only when (getgrname name) fails.
This commit is contained in:
Ludovic Courtès 2014-06-04 23:08:09 +02:00
parent 185f669109
commit e2fcc23a3a
1 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,8 @@ numeric gid or #f."
;; Then create the groups. ;; Then create the groups.
(for-each (match-lambda (for-each (match-lambda
((name password gid) ((name password gid)
(add-group name #:gid gid #:password password))) (unless (false-if-exception (getgrnam name))
(add-group name #:gid gid #:password password))))
groups) groups)
;; Finally create the other user accounts. ;; Finally create the other user accounts.