Skip to content
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

pass on exit code %errorlevel% of governed process #66

Closed
klin333 opened this issue Mar 20, 2024 · 2 comments
Closed

pass on exit code %errorlevel% of governed process #66

klin333 opened this issue Mar 20, 2024 · 2 comments
Assignees
Milestone

Comments

@klin333
Copy link

klin333 commented Mar 20, 2024

Hi,

When a task is run under process governor, the error status code of the governed process seems to get lost, and is not passed on by procgov. See example below, showing a success status code 0 even though i tried to cat a non-existent file.

Is it possible to always return the %errorlevel% status code of the governed process, when procgov itself encountered no errors.

Thanks

C:\Users\xxx\workspace\bin\procgov>ls
procgov32.exe  procgov32.pdb  procgov64.exe  procgov64.pdb

C:\Users\xxx\workspace\bin\procgov>cat doesnotexist.txt
cat: doesnotexist.txt: No such file or directory

C:\Users\xxx\workspace\bin\procgov>echo %errorlevel%
1

C:\Users\xxx\workspace\bin\procgov>procgov64.exe --maxmem 10G -- cat.exe doesnotexist.txt
Process Governor v1.0.0.0 - sets limits on processes
Copyright (C) 2023 Sebastian Solnica (lowleveldesign.org)

Maximum committed memory (MB):              10,240

Press Ctrl-C to end execution without terminating the process.

cat: doesnotexist.txt: No such file or directory

C:\Users\xxx\workspace\bin\procgov>echo %errorlevel%
0

C:\Users\xxx\workspace\bin\procgov>
@lowleveldesign
Copy link
Owner

Thanks for the suggestion. I think that when no --nowait option is provided, I will return an error code when procgov or the target application fails. I plan to do some work on this project in the coming weeks, so this should be ready for the next release.

@lowleveldesign
Copy link
Owner

Starting from v2.13 procgov will return the exit code of the initial process (the one provided in the command line, as in your example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants