[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: handling group membership in and outside d-i



Quoting Jon Dowland (jon+debian-devel@alcopop.org):

> I did several subsequent installs and my user never ended
> up in powerdev (nor netdev for that matter). It's my belief
> (yet to check d-i code to confirm) that the user gets added
> to powerdev if you select the desktop task: for each of my

Not really. It *should* be added to that group.

The package responsible for this in D-I is "user-setup"
(svn+ssh://svn.debian.org/svn/d-i/trunk/packages/user-setup)

The first user is created with the "user-setup-apply" script:

        if [ -x $ROOT/usr/sbin/adduser ]; then
                $log $chroot $ROOT adduser --disabled-password --gecos "$RET" $UIDOPT "$USER" >/dev/null || true
        else
                $log $chroot $ROOT useradd -c "$RET" -m "$USER" $UIDOPT >/dev/null || true
        fi

        # Clear the user password from the database.
        db_set passwd/user-password-crypted ''
        db_set passwd/user-password ''
        db_set passwd/user-password-again ''
        setpassword "$USER" "$USER_PW" "$USER_PW_CRYPTED"

        if [ "$HOME_EXISTED" ]; then
                # The user's home directory already existed before we called
                # adduser. This often means that a mount point under
                # /home/$USER was selected in (and thus created by) partman,
                # and the home directory may have ended up owned by root.
                $log $chroot $ROOT chown "$USER:$USER" "/home/$USER" >/dev/null || true
        fi

        if [ -n "$USER" ]; then
                db_get passwd/user-default-groups
                for group in $RET; do
                        $log $chroot $ROOT adduser "$USER" $group >/dev/null 2>&1 || true
                done
        fi



passwd/user-default-groups is a debcof setting that's preseedable and
for which the default is:

# Allow preseeding the groups to which the first created user is added
Template: passwd/user-default-groups
Type: string
Default: audio cdrom dialout floppy video plugdev netdev powerdev
Description: for internal use only


In short....the first created user *should* be in powerdev. If it is
not....then there's a bug in user-setup (or somewhere else...).


(CC'ing Colin Watson who's well aware about that part of the code,
IIRC)


Attachment: signature.asc
Description: Digital signature


Reply to: