mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
A new VM can get network policy: --network-policy, else a question in a terminal (no by default), else off. devvm makes its CA, writes the VM's secret bindings, starts the VM's proxy (devvm _proxy, its password in a file) and starts the VM confined to it, then runs the self-check before the setup and the shell: a VM that isn't held to its proxy is stopped. Tokens stay on the host; the hidden devvm secret get reads them for the proxy, from the Keychain or a file. e2e gets a network section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
18 lines
379 B
Go
18 lines
379 B
Go
package platform
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
// ProcessArgs returns a running process's arguments, its program's name
|
|
// first, from /proc.
|
|
func ProcessArgs(pid int) ([]string, error) {
|
|
b, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/cmdline")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return strings.Split(strings.TrimSuffix(string(b), "\x00"), "\x00"), nil
|
|
}
|