could you try to run both through strace -f
?
mpech: strace -f pijul uptime -> https://envs.sh/gZ.txt
root: strace -f pijul uptime -> https://envs.sh/gL.txt
ok, difference:
# root
[pid 176369] execve("/root/.gem/ruby/3.0.0/bin/pijul-uptime", ["pijul-uptime"], 0x7ffdeed5b960 /* 29 vars */) = -1 ENOENT (No such file or directory)
[pid 176369] write(2, "No such subcommand: ", 20No such subcommand: ) = 20
# mpech
[pid 176307] execve("/root/.gem/ruby/3.0.0/bin/pijul-uptime", ["pijul-uptime"], 0x7fff448f16e0 /* 64 vars */) = -1 EACCES (Permission denied)
[pid 176307] write(2, "Error while running ", 20Error while running ) = 20
so this is somewhat expected, mpech can’t access /root/.gem/ruby/3.0.0/bin
, but I wonder how that ended up in $PATH
(I suppose pijul / rust runtime just uses that to find executables via name)…
Huh, why is it even attempting to execute pijul-uptime
to begin with? Subcommands are actually separate binaries now? If not, then I do not understand the reason. Plus, since the executable pijul-uptime
does exist and as root you do have permission for it, how come it says there is no such subcommand? That makes me think that after all, no, subcommands are not separate binaries, but for unknown reasons it tries to execute pijul-SUBCOMMAND
that it finds in $PATH
and is most likely a bug. So after all, the important and odd thing here is that it attempts to execute the command pijul-SUBCOMMAND
from $PATH
instead of its own internal subcommand argv[1]
, which is uptime
in this case.
May I have some clarification please?
@coconut: there are “core” subcommands, and the Pijul CLI is extensible: if Pijul can’t find a subcommand with some name, it will try to run pijul-…
instead.
I can’t reproduce this one (I get “No such command” as a non-root user). @tankf33der, if you still run into this, can you tell us more about your $PATH
(is /root/.gem/ruby/3.0.0/bin
in mpech
’s $PATH
?).
Thanks. Just out of curiosity, what happens when you run pijul-uptime
in a bash shell, both as mpech and as root?
Right, but there you typed pijul uptime
(without the -
), my question was, is the error coming from Pijul or from the shell itself? Pijul looks for a binary called pijul-uptime
in that case, so knowing what the shell returns would give an idea of what to do.
I dont understand how to check if error coming from shell. I missed the point.
Sorry for being unclear, I was just asking you about the outcome of running pijul-uptime
(mind the -
, this is not pijul uptime
) directly in a shell, as both users.
Good to know. The “problem” seems to come from the way execvpe
uses $PATH
. The only thing we can do is probably the same bash is doing: report a permission error as a “subcommand not found”, which is what I’ve done in #NIDZT2SQUZHH4YZWNQLSJYRHZPGT2EAGHHJHGZF2XYEFUL3N3YIQC.
If I run wrong subcommand from user or root it gives me different errors: