haproxytech / dataplaneapi

HAProxy Data Plane API
https://www.haproxy.com/documentation/dataplaneapi/
Apache License 2.0
328 stars 76 forks source link

Use textual user/group names instead of numeric uid/gid #340

Open raspbeguy opened 4 months ago

raspbeguy commented 4 months ago

Hello,

I wish there would be a way to specify the user and group to set at start by using their textual names (example: haproxy) instead of numeric ids. This would make greatly easier to automate deployment, for example via distro-packaging. Indeed, when a package creates a user it lets the OS decide the uid/gid to be sure not to use something already in use.

smeroth commented 2 weeks ago

Hello

Not sure to well understand the context. Can you describe me a bit more what is blocking ? what is annoying ? what you need to do to workaround this limitation ?

Thanks in advance

raspbeguy commented 2 weeks ago

Hello, sorry if my explanation was not clear.

dataplaneapi has two parameters --uid and --gid that accept numeric IDs. I wish there was a way to specify user/group names instead of IDs.

It makes designing deployment automation difficult, because when you create a user you have then to get its uid and populate the service file with this uid, which is rarely possible when it is packaged in a distribution. Of course you can specify a static arbitrary uid when creating the user, but then it will fails if the uid exists already.

Usually service file refers to users/groups names for that reason.

smeroth commented 2 weeks ago

Thanks for the updated context. Let me discuss that with the engineering. We have to check what could be the impact on the code if --uid and --gid are not only numeric values. I'll keep you updated.