ServerContainers / samba

samba - (ghcr.io/servercontainers/samba) (+ optional zeroconf, wsdd2 & time machine) on alpine [x86 + arm]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Username cannot be added

siochs opened this issue · comments

data.env:

WSDD2_DISABLE=true
AVAHI_DISABLE=true
GROUP_foo=1001
ACCOUNT_foo=mooh
UID_foo=1001
GROUPS_foo=foo
SAMBA_CONF_LOG_LEVEL=3
SAMBA_CONF_MAP_TO_GUEST=never
SAMBA_VOLUME_CONFIG_data=[data]; comment=data share on server; path=/shares/data; writeable=yes; guest ok=no; read only=no

run:

docker run --rm --env-file ./data.env -v /path/to/data:/shares/data -p 139:139 -p 445:445 ghcr.io/servercontainers/samba:smbd-only-latest

Returns me that the user foo cannot be added:

mkdir: can't create directory '/var/run/samba': File exists
>> CONTAINER: starting initialisation
cp: can't stat '/container/config/avahi/samba.service': No such file or directory
>> SAMBA CONFIG: no $SAMBA_CONF_WORKGROUP set, using 'WORKGROUP'
>> SAMBA CONFIG: no $SAMBA_CONF_SERVER_STRING set, using 'Samba Server'
>> GROUP: adding group foo with GID: 1001
>> ACCOUNT: adding account: foo with UID: 1001
adduser: uid '1001' in use

which will lead to follow up errors.

I execed into the container and indeed cannot create the user, but /etc/passwd does not show up the user. On other systems it appears to be no problem to add a user and a group with the same name and ids.

Any idea?

Hi,
I have the same problem with uid 1000

commented

interessting and strange problem - I'll have a look!

commented

Problem found, please remove

GROUP_foo=1001
GROUPS_foo=foo

the default group for a user is automatically created when the user is created - they automatically share the same id.
that's why the error is complaining that the id is already in place.

the GROUP_<name>=<gid> is meant for groups which are not automatically created and you create for grouping different users together - like a family group for GROUP_family=4000 or a certain department GROUP_hr=4001 and later on make your users members of the group using GROUPS_family=alice,bob

commented

updated readme to be more specific on this topic

Perfect, it works for me
Thanks.