-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
exec: inconsistent Args semantics #793
Comments
AIUI, and I remember we all discussed this at the conference, the main reason this is allowed, is so that a user can "customize" the displayed process name. If that's the case, instead we could add a The important thing is that we don't want the user to have to specify argv[0] twice. To avoid ambiguity, I ask that you perhaps make an Thanks! |
Sure. Here's an mcl code for the current implementation:
Here's the code for the proposed change:
Note that removing The use-case of overriding the display name of the process is dubious to me. However, if you really want to do it, I would suggest to go the other way, and to override the executable binary path, again, to be consistent with the usual
|
I guess this is kind of dependent on: #794 |
As discussed in cnfgmngmntcmp.
Currently the Args parameter of the exec resource[1] is inconsistent with both the Golang's os.exec[2] and with C's exec(3) family of methods. For example, to call an equivalent of shell command "/usr/bin/ls -l /tmp" you would make the following calls:
In C:
In golang:
(Note that golang also provides the
exec.Command()
convenience method that populates Cmd.Path with the first element of Cmd.Args, however the structure of the exec resource matches the structure of the exec.Cmd struct, which may cause (and has caused) confusion).My suggestion is to replace the Args and Cmd parameters with a single Command parameter that behaves exactly as the
exec.Command
in golang, and does not cause additional confusion. The use of Cmd is also limited and, as also discussed before (and as I will reiterate in my next issue), flawed.[1] https://mgmtconfig.com/docs/resources/#exec
[2] https://pkg.go.dev/os/exec
The text was updated successfully, but these errors were encountered: