docs/178221: Addition to handbook jails chapter: warning about make deinstall
Brandon Thomson
bt at brandonthomson.com
Thu May 2 04:50:02 UTC 2013
The following reply was made to PR docs/178221; it has been noted by GNATS.
From: Brandon Thomson <bt at brandonthomson.com>
To: freebsd-gnats-submit at FreeBSD.org
Cc:
Subject: Re: docs/178221: Addition to handbook jails chapter: warning about
make deinstall
Date: Thu, 2 May 2013 04:48:04 +0000
>>When setting up a machine according to the "Application of Jails"
>>section of FreeBSD Handbook [1], one runs into a problem where "make
>>deinstall" inside of a jail does not work as expected. There is a
>>workaround, which probably should be noted in the chapter.
>>
>>Note that this only applies to ports installed in a jail. Ports
>>installed on the base system do not need the workaround.
>>
>>[1] http://www.freebsd.org/doc/handbook/jails-application.html
>>
>>Original thread [2]: http://forums.freebsd.org/showthread.php?p=213757
>>
>>The workaround is to use "make deinstall PREFIX=/s/usr-local", where
>>/s/usr-local is whatever make spits out when you type make
>>deinstall. If you followed the handbook instructions exactly it will
>>be /s/usr-local.
>If you're actually running *inside* the jail, you shouldn't see that
>prefix.
Do you mean the directory /s/usr-local should not be visible inside the jail?
On the jails I have set up it is, and I believe that is in accord with the
instructions in [1].
For example if /s/usr-local were not visible inside the jail, the symlink at
/usr/local pointing to ../s/usr-local would be a broken link.
So, I think the PREFIX of /s/usr-local *should* be visible inside the jail.
>Where you need to run the command that way is if you're using the parent
>system to update the port that the jail runs. But then your "make
>install" process is not actually *in* the jail at all.
I did not attempt to deinstall a port run by the jail from the parent system.
My attempt was from inside the jail environment, using jexec.
I agree that one would *also* need to adjust the PREFIX if one wanted to
deinstall a port in the jail from the parent system. In this case, the PREFIX
would need to be set to /usr/jails/s/myjail/usr-local or similar.
However, the point of this issue is that PREFIX also needs to be set when
running "make deinstall" *inside* the jail environment. If you don't set PREFIX,
you will run into the error described in [2].
Note that the host's /usr/jails/s/myjail should be mounted to /s inside the
jail, so the PREFIX inside the jail is: /s/usr-local.
Hope that makes sense! Jail paths can be really confusing :(
I suppose it's also possible that both myself and the original poster in [2]
have failed to follow the instructions in [1] correctly in some way that is
causing this issue to arise, but that seems unlikely to me.
Warm regards,
Brandon
More information about the freebsd-doc
mailing list