Bug 259710 - Environment variable JAIL causes pkg -j to malfunction
Summary: Environment variable JAIL causes pkg -j to malfunction
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Package Infrastructure (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-11-08 12:01 UTC by Richard Smith
Modified: 2021-11-08 12:50 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Richard Smith 2021-11-08 12:01:46 UTC
If an environment variable called JAIL is defined when invoking "pkg -j" to install a package (e.g. webp) into a jail (e.g. test), the POST-INSTALL script fails to run with the following error message:

    jexec: jail "test" not found
    pkg: POST-INSTALL script failed

Reproduced using:
    # env JAIL=test pkg -j test install webp

Same problem occurs with "delete" command and POST-DEINSTALL script. The problem is present in FreeBSD 12.1 and FreeBSD 13.0.
Comment 1 Baptiste Daroussin freebsd_committer 2021-11-08 12:08:32 UTC
where does that "    jexec: jail "test" not found"

pkg is not issuing such error message, neither does libjail which is what pkg uses
Comment 2 Baptiste Daroussin freebsd_committer 2021-11-08 12:10:13 UTC
Can you show me the output of:

env JAIL=test pkg -o DEBUG_SCRIPTS=true -j test install webp
Comment 3 Richard Smith 2021-11-08 12:50:52 UTC
# env JAIL=ballet pkg -o DEBUG_SCRIPTS=true -j ballet install webp
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	webp: 1.2.1

Number of packages to be installed: 1

The process will require 3 MiB more space.

Proceed with this action? [y/N]: y
[ballet.motoko.rdls.net] [1/1] Installing webp-1.2.1...
[ballet.motoko.rdls.net] [1/1] Extracting webp-1.2.1: 100%
+ set -- webp-1.2.1
+ /usr/sbin/service ldconfig restart
jexec: jail "ballet" not found
+ [ -z '' ]
+ exit 1
pkg: POST-INSTALL script failed