Skip to content

c8y-remote-access-plugin init using non-standard/non-root user #2886

@reubenmiller

Description

@reubenmiller

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 --init
thread '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:58

Describe 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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions