init_userconf.sh: only add line to /etc/sudoers once#996
init_userconf.sh: only add line to /etc/sudoers once#996eitsupi merged 1 commit intorocker-org:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the container init script to avoid repeatedly appending the same sudoers rule on every container start, making the startup behavior idempotent.
Changes:
- Introduces variables for the sudoers rule line and target file.
- Adds a
grepcheck intended to only append%sudo ALL=(ALL) NOPASSWD:ALLwhen it is not already present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The script `init_userconf.sh` is installed into `/etc/cont-init.d/02_userconf` and will be run every time the container is started. Currently, if the container is restarted multiple times, the line `%sudo ALL=(ALL) NOPASSWD:ALL` will be added each time the container is started. This change checks if the line already exists and does not add it if it does.
2c69a97 to
ba37575
Compare
|
I implemented Copilot's suggestion. Thanks AI! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Weird errors. The lint error is The build error seems to be related to a 500 URL error |
|
Thank you for your contribution! I'll check it later and merge it. |
The script
init_userconf.shis installed into/etc/cont-init.d/02_userconfand will be run every time the container is started.Currently, if the container is restarted multiple times, the line
%sudo ALL=(ALL) NOPASSWD:ALLwill be added each time the container is started.This change checks if the line already exists and does not add it if it does.