Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-9681

fchroot: return exit code of process executed in chroot

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None

      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 $?

      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 $?

      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.

            Unassigned Unassigned
            drobbins drobbins
            0 Vote for this issue
            1 Start watching this issue