Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postinst in example-raw needs rework ? #75

Open
ydirson opened this issue Oct 24, 2021 · 5 comments
Open

postinst in example-raw needs rework ? #75

ydirson opened this issue Oct 24, 2021 · 5 comments

Comments

@ydirson
Copy link

ydirson commented Oct 24, 2021

example-raw/files/postinst reads:

if ! getent passwd isar >/dev/null; then
        useradd --system --gid isar --create-home \
                --home /var/lib/isar --no-user-group \
                --comment "My isar user" \
                isar
fi

# since the homedir was part of the package, useradd did not include skel
cp -RTn /etc/skel ~isar

This last comment about "homedir was part of the package" does not seem to be correct (any more?), so likely the skel copy should occur on useradd. After removing this line the generated image still gets those files populated. Possibly more should be cleaned up at the same time ?

@henning-schild
Copy link
Contributor

Please go more into detail here. Steps to reproduce and problems you see.

bbnote "A user-specific HOME entry"

bbnote "A HOME entry for everyone ... created after this is installed"

At the end you want to see both these files in the homedir, and possibly more coming from /etc/skel via other packages.

@amikan
Copy link
Collaborator

amikan commented Nov 16, 2021

Tried debian-stretch and debian-bullseye: both do not copy skel in useradd even if explicitly set -k /etc/skel.
So we can't remove that hack so far.

@henning-schild
Copy link
Contributor

Is is a hack? Does any distro copy skel if HOME exists on useradd?

@amikan
Copy link
Collaborator

amikan commented Nov 16, 2021

At least it looks like a hack.
Maybe we can add a user other then isar with other homedir here to make things more clear.

@henning-schild
Copy link
Contributor

Maybe it is too many examples in one but it serves the purpose to show how to populate a users homedir from multiple sources.

But please stay on topic so we can close this. I will stop here because we do not do issues in this project but unfortunately they are not disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants