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

bastille cmd exit code not respected #272 #303

Merged
merged 3 commits into from
Jul 31, 2021

Conversation

yerrysherry
Copy link

I think there are 2 possibilities, execute a command in 1 jail or in all running jails.

When executing in one jail. I returned the right exit code:

root@bastille:# bastille cmd test cat /etc/passwd
[test - Return code]: 0
root@bastille:
# echo $?
0

root@bastille:~ # bastille cmd test more xxx
[test]:
xxx: No such file or directory
[test - Return code]: 1

root@bastille:~ # echo $?
1

root@bastille:~ # bastille cmd test diff /test1 /test2
[test]:
diff: /test1: No such file or directory
[test - Return code]: 2

root@bastille:~ # echo $?
2

Running a command in all running jails:
After each jail, I returned the exit code. If everything runs fine, I return "0", otherwise "1"

root@bastille:~ # bastille cmd ALL diff /test1 /test2
[test]:
diff: /test1: No such file or directory
[test - Return code]: 2

[test1]:
diff: /test1: No such file or directory
[test1 - Return code]: 2

root@bastille:~ # echo $?
1

@cedwards cedwards self-requested a review January 5, 2021 00:13
@cedwards cedwards added the enhancement New feature or request label Jan 5, 2021
@cedwards cedwards merged commit 7f1dbc1 into BastilleBSD:master Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants