Skip to content

[packaging] Create pyroscope unix group #2485

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

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

wilfriedroset
Copy link
Contributor

This PR create a unix group for pyroscope user. This will facilitate permission management down the road.
Bonus point: it is similar to mimir packaging. This could be an improvement for loki

@wilfriedroset wilfriedroset requested a review from a team as a code owner October 4, 2023 12:10
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding group, I tried to add it, but it was too hard 🙂 .

See my comments, why the change you were proposing is not working.

I tested on docker images debian:11 and fedora:38

# Create the user
if ! id pyroscope > /dev/null 2>&1 ; then
adduser --system --home /var/lib/pyroscope --shell /bin/false "pyroscope"
adduser --create-home --system --home /var/lib/pyroscope -g pyroscope --shell /bin/false "pyroscope"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think debian doesn't like create-home and only shares --gid with the redhat variant:

Suggested change
adduser --create-home --system --home /var/lib/pyroscope -g pyroscope --shell /bin/false "pyroscope"
adduser --system --home /var/lib/pyroscope --gid $(getent group | grep pyroscope: | awk -F ":" '{ print $3 }') --shell /bin/false "pyroscope"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a little improvement to your suggestion.
WDYT?

@wilfriedroset wilfriedroset force-pushed the packaging-system-group branch from 70f9ab9 to 0abdc18 Compare October 5, 2023 14:29
@wilfriedroset wilfriedroset force-pushed the packaging-system-group branch from 0abdc18 to 57dd6a1 Compare October 9, 2023 20:44
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simonswine simonswine merged commit a7ed8fb into grafana:main Oct 11, 2023
simonswine pushed a commit that referenced this pull request Oct 11, 2023
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

Successfully merging this pull request may close these issues.

2 participants