Details
-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
Description
Since 0.2, fchroot and chroot behave differently, and fchroot does not return the exit code of the command last executed. For example, I wrote a test.sh script that has an "exit 3" in it, and here is how chroot handles the return code:
lilliputian /var/tmp/stage3 # chroot . /test.sh lilliputian /var/tmp/stage3 # echo $? 3
In contrast, here is how fchroot handles it:
lilliputian /home/drobbins/development/ffs # fchroot . /test.shFuntoo fchroot 0.2 ("Darth Elmo"); Copyright 2020-2022 Funtoo Solutions, Inc.
Licensed under the Apache License, Version 2.0>>> Entering arm-64bit (cortex-a53 CPU) fchroot...
<<< Exiting fchroot.
lilliputian /home/drobbins/development/ffs # echo $?
0
The return code returned by fchroot should be 3, not 0. This is a regression in the 0.2+ versions. We will need this return code to be fixed to correctly identify errors when using fchroot with ffs.