Closed ladyrick closed 9 months ago
Please add get_exist_path to systemctl3.pyi
Please add get_exist_path to systemctl3.pyi
Done.
Ahh, mypy asks for explicit return None in get_exist_path(paths):
Ahh, mypy asks for explicit return None in get_exist_path(paths):
Nice, All checks have passed this time.
I will do some more checks locally before pushing to master though. In any case, thanks a lot for the patch, that is really helpful for the project to continue.
Fix SyntaxWarning: invalid escape sequence '\w'
Support multiple cmd path. Sometimes the "cat" command is not "/usr/bin/cat". So I change
CAT_CMD
to a list of candidatesCAT_CMDS
and search for the first existing path. Same change forLESS_CMD
andTAIL_CMD
.In
log_unit_from
, instead ofspawnvp
a new process forcat
/tail
/less
, I useexecvp
to replace current process. By doing this,systemctl
needn't to handle the exit code and errors. For example, before this PR, when I usesystemctl log -f service
to see the log and then use ctrl+c to exit, I will get an ugly error like this. But when this PR is accepted, the tail command will exit directly and no error will show.