-
Notifications
You must be signed in to change notification settings - Fork 72
c8y-remote-access-plugin init using non-standard/non-root user #2886
Copy link
Copy link
Closed
Description
Is your feature improvement request related to a problem? Please describe.
Running c8y-remote-access-plugin --init on a system which is using a non-standard user (e.g. anything other than "tedge") causes the following error.
c8y-remote-access-plugin --config-dir /opt/homebrew/etc/tedge --initthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: × Failed to initialize c8y-remote-access-plugin. You have to run the command
│ with sudo.
├─▶ Creating supported operations directory
╰─▶ User not found: "tedge".
', crates/core/tedge/src/main.rs:50:58Describe the solution you'd like
If tedge init --user myuser --group mygroup can be run with a custom user, then c8y-remote-access-plugin --init should also not have a problem with it.
It might make sense just to create the file using the permissions of the user running it, and ensure it is set to 644 so it can be read by other users.
Describe alternatives you've considered
Additional context
This is where the logic is defined in the code:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
improvementUser valueUser value