-
Notifications
You must be signed in to change notification settings - Fork 41
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
DOCS-2705: Add username and env attributes for processes #3649
base: main
Are you sure you want to change the base?
Conversation
| Executable (`name`) | string | **Required** | The command you want to execute when your machine connects to the server. On many operating systems, you can find the executable path of commands by running `which <command-name>`. | | ||
| Arguments (`args`) | string | Optional | Arguments to follow the command. | | ||
| Working directory (`cwd`) | string | Optional | Where you want the process to execute. Defaults to the directory where `viam-server` executes. | | ||
| `username` (not available in builder mode) | string | Optional | Example: `"username": "ubuntu"`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zaporter-work I was not able to confirm that the username
attribute does anything. My assumption is that it would allow us to run the process as a user?
On my pi I added a process with this config:
{
"env": {
"SVC_API_KEY": "VALUE"
},
"username": "pi",
"id": "process-2",
"name": "python",
"args": [
"username.py"
],
"cwd": "/home/pi",
"log": true,
"one_shot": false
}
and this little python program:
import os
import getpass
import time
while True:
print(1)
print(time.sleep(1))
raise ValueError(getpass.getuser())
I can't see anytihng printed at all and what gets raised always indicates that the process runs as root
.
Does username
do somethign else?
| Arguments (`args`) | string | Optional | Arguments to follow the command. | | ||
| Working directory (`cwd`) | string | Optional | Where you want the process to execute. Defaults to the directory where `viam-server` executes. | | ||
| `username` (not available in builder mode) | string | Optional | Example: `"username": "ubuntu"`. | | ||
| `env` (not available in builder mode) | string | Optional | Environment variables for the process. Example: `"environment": { "SVC_API_KEY":"VALUE" }`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zaporter-work could you confirm for me how the config for a machine reaches the machine? That's all e2e encrypted right? I think we should probably mention that here.
You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/3649 |
No description provided.