Re: stagedir vs. jail
And answering the question (weird: the on I was asking too...) just in case someone still needs the solution. I upgraded to latest release 9.2, rebuilt jails (by the book) and the issue is gone: all works like a charm, no staging directory problem. Thanks. Valeri Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 On Mon, November 18, 2013 7:43 pm, Valeri Galtsev wrote: Hi Ekkehard, Did you find the solution or workaround? Could you point to it of you you found one. As I still have this problem in quite a few on jails, so, it doesn't look like it was solved on jail support or port support level. Thanks. Valeri On Sun, October 13, 2013 7:19 am, Ekkehard Gehm wrote: A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki On Sun, 13 Oct 2013, Ekkehard Gehm wrote something like: Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content
Re: stagedir vs. jail
Hi Ekkehard, Did you find the solution or workaround? Could you point to it of you you found one. As I still have this problem in quite a few on jails, so, it doesn't look like it was solved on jail support or port support level. Thanks. Valeri On Sun, October 13, 2013 7:19 am, Ekkehard Gehm wrote: A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki On Sun, 13 Oct 2013, Ekkehard Gehm wrote something like: Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else.
Re: stagedir vs. jail
Ahoi! On Mon, 14 Oct 2013, Mark Felder wrote something like: Do I understand this situation correctly: Users are having issues with building/installing packages with STAGEDIR enabled in lightweight jails that use symlinks to share parts of the base system between many jails to make it easier to upgrade the jails and avoid duplication/wasted disk space? It seems that the handbook and ezjails may both replicate this behavior. http://www.freebsd.org/doc/handbook/jails-application.html If this is correct, the only workaround may be for you to use a private package repository constructed by poudriere and to not actually build your packages within the jails you intend to use them in. The types of jails you are using are certainly a supported method for running jails, but I can see the severe limitations it imposes on the newer package building method which is designed to ensure packages are built as accurately and reliably as possible. Maybe bapt co can find a workaround for this, but this does sound like an edge case. So it is my buissness to install pkg for all my users then? Or: If I'm using a Jail to test a bit of software I have to build them in the main system? The problem is that this stagedir thing (or at least pkg_create) misinterprets Symlinks. That is, in my opinion, a bug not a feature! Please keep in mind that there are some growing pains as the ports team attempts to mature packages on FreeBSD so we can one day go from 90% users build from ports and only 10% using packages to a reality where 90% of the users are able to use packages and only 10% have to build from ports. I should note that I successfully run these types of jails but I run poudriere from the host to have private package repositories. It makes it very easy to pop into a jail and run pkg upgrade and instantly the jail is updated and I can restart services or quickly restart the entire jail. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? pgpZVvmqx0COj.pgp Description: PGP signature
Re: stagedir vs. jail
On 15/10/2013 2:41 AM, Scot Hetzel wrote: On Sun, Oct 13, 2013 at 9:27 AM, Dewayne dewayne.gerag...@heuristicsystems.com.au wrote: My setup is slightly different, where I do use as Matthew recommends, nullfs is used without symlinks; and pkg_* and portmaster are used for the build process. We've been using jails to build ports for different architectures for years, the builds are currently on a FreeBSD 9.2Stable (Built from source on Oct 8) system. Building all ports after a complete wipe, using the portmaster commands fails due to missing file + portmaster --no-term-title --no-confirm -H -K -D -g -G -B -v -m __MAKE_CONF=/etc/make_P3.conf -m -DBUILD__PRODUCTION mail/sendmail tar: etc/rc.d/saslauthd: Cannot stat: No such file or directory tar: Error exit delayed from previous errors. pkg_create: make_dist: tar command failed with code 256 In fact the file does exist: # ls -lh /usr/staging/usr/local/etc/rc.d/saslauthd -r-xr-xr-x 1 root wheel 940B Oct 14 00:55 /usr/staging/usr/local/etc/rc.d/saslauthd and not in /usr/local/etc/rc.d/ As you can see sendmail builds saslauthd as a prerequisite. The build process also fails in the same way, missing file in etc/rc.d/... for samba36, samba4, isc-dhcp42-server and cyrus-sasl2-saslauthd, but works correctly for some 40 other packages. The make.conf includes: WRKDIRPREFIX=/var/ports DISTDIR=/distfiles TMPDIR=/tmp PACKAGES=/packages STAGEDIR=/usr/staging FAVORITE_COMPILER=gcc DEFAULT_VERSIONS=perl5=5.16 python=2.7 python2=2.7 apache=22 DISABLE_LICENSES=yes # Not that I want to, only that it prevented the build (a PR existed for this) WITH_CCACHE_BUILD=yes MAKE_JOBS_UNSAFE=yes I suspect the problem lies within the if/then block .if !target(install-rc-script) in bsd.port.mk, but lack the know-how to proceed further. I have sent PR 182972 regarding this issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=182972 The cause of the issue is due to setting STAGEDIR in /etc/make.conf and Mk/bsd.port.mk not undefining STAGEDIR when NO_STAGE is set. Which causes the install-rc-script to look in the STAGEDIR for the file. Scot ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org Thank-you Scott, the patch provided in the PR does fix the problem :) I use pkg_*, portmaster and the portconf to customise 127 ports of the 507 used. Its a pretty rudimentary setup which has been used to build packages, for different architectures inside jails for many years. How is it that this type of problem isn't being picked up in testing before being deployed in the live ports system? If I don't set STAGEDIR inside /etc/make.conf where do I define it? Unfortunately I didn't see your reply before I created this PR http://www.freebsd.org/cgi/query-pr.cgi?pr=182997 for those that were continuing to have the problem and the ugly workaround. Though I'm very pleased that it was addressed in the right place, which you have done :) Appreciate your help. Kind regards, Dewayne. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
Do I understand this situation correctly: Users are having issues with building/installing packages with STAGEDIR enabled in lightweight jails that use symlinks to share parts of the base system between many jails to make it easier to upgrade the jails and avoid duplication/wasted disk space? It seems that the handbook and ezjails may both replicate this behavior. http://www.freebsd.org/doc/handbook/jails-application.html If this is correct, the only workaround may be for you to use a private package repository constructed by poudriere and to not actually build your packages within the jails you intend to use them in. The types of jails you are using are certainly a supported method for running jails, but I can see the severe limitations it imposes on the newer package building method which is designed to ensure packages are built as accurately and reliably as possible. Maybe bapt co can find a workaround for this, but this does sound like an edge case. Please keep in mind that there are some growing pains as the ports team attempts to mature packages on FreeBSD so we can one day go from 90% users build from ports and only 10% using packages to a reality where 90% of the users are able to use packages and only 10% have to build from ports. I should note that I successfully run these types of jails but I run poudriere from the host to have private package repositories. It makes it very easy to pop into a jail and run pkg upgrade and instantly the jail is updated and I can restart services or quickly restart the entire jail. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
I have actually noticed many times earlier that using symlinks for /usr/ports, /usr/src and the related directories do cause problems, jails or not. -Kimmo ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
On Sun, Oct 13, 2013 at 9:27 AM, Dewayne dewayne.gerag...@heuristicsystems.com.au wrote: My setup is slightly different, where I do use as Matthew recommends, nullfs is used without symlinks; and pkg_* and portmaster are used for the build process. We've been using jails to build ports for different architectures for years, the builds are currently on a FreeBSD 9.2Stable (Built from source on Oct 8) system. Building all ports after a complete wipe, using the portmaster commands fails due to missing file + portmaster --no-term-title --no-confirm -H -K -D -g -G -B -v -m __MAKE_CONF=/etc/make_P3.conf -m -DBUILD__PRODUCTION mail/sendmail tar: etc/rc.d/saslauthd: Cannot stat: No such file or directory tar: Error exit delayed from previous errors. pkg_create: make_dist: tar command failed with code 256 In fact the file does exist: # ls -lh /usr/staging/usr/local/etc/rc.d/saslauthd -r-xr-xr-x 1 root wheel 940B Oct 14 00:55 /usr/staging/usr/local/etc/rc.d/saslauthd and not in /usr/local/etc/rc.d/ As you can see sendmail builds saslauthd as a prerequisite. The build process also fails in the same way, missing file in etc/rc.d/... for samba36, samba4, isc-dhcp42-server and cyrus-sasl2-saslauthd, but works correctly for some 40 other packages. The make.conf includes: WRKDIRPREFIX=/var/ports DISTDIR=/distfiles TMPDIR=/tmp PACKAGES=/packages STAGEDIR=/usr/staging FAVORITE_COMPILER=gcc DEFAULT_VERSIONS=perl5=5.16 python=2.7 python2=2.7 apache=22 DISABLE_LICENSES=yes # Not that I want to, only that it prevented the build (a PR existed for this) WITH_CCACHE_BUILD=yes MAKE_JOBS_UNSAFE=yes I suspect the problem lies within the if/then block .if !target(install-rc-script) in bsd.port.mk, but lack the know-how to proceed further. I have sent PR 182972 regarding this issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=182972 The cause of the issue is due to setting STAGEDIR in /etc/make.conf and Mk/bsd.port.mk not undefining STAGEDIR when NO_STAGE is set. Which causes the install-rc-script to look in the STAGEDIR for the file. Scot ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
On Sun, Oct 13, 2013 at 12:58:53PM +0200, Ekkehard Gehm wrote: Hey! I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. we would need more details about your setup and what you use for buildling packages. the packages builder cluster are builind things in jail and it perfectly works. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Nope that doesn't work as there is no way to globally disable staging, if you add NO_STAGE in make.conf all you end up with is a messed package db, if you are very very lucky it might sometime work. Bapt pgpULUKVWZ3LE.pgp Description: PGP signature
Re: stagedir vs. jail
On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey signature.asc Description: OpenPGP digital signature
Re: stagedir vs. jail
Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? pgpo0uAPjc7hp.pgp Description: PGP signature
Re: stagedir vs. jail
A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki On Sun, 13 Oct 2013, Ekkehard Gehm wrote something like: Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are
Re: stagedir vs. jail
On Sun, Oct 13, 2013 at 4:19 PM, Ekkehard Gehm g...@doom-labs.net wrote: A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki Why can't you use poudriere as the package builder? Poudriere does not use any symbolic link tricks and that's why things just work out of the box. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
RE: stagedir vs. jail
On Sun, Oct 13, 2013 at 12:58:53PM +0200, Ekkehard Gehm wrote: Nope that doesn't work as there is no way to globally disable staging, if you add NO_STAGE in make.conf all you end up with is a messed package db, if you are very very lucky it might sometime work. I know this method is frowned upon because it's not a method which was intended to be used by end users, but I have to disagree with you here: this setting seems to work flawlessly in disabling staging. In my situation I'm using a /tmp directory which has the exec flag disabled in order to prevent escalation whenever a customer website uses scripts which aren't as secured as they (c/sh)ould have been. At the very least it blocks 3rd parties from having an easy place to execute their stuff. Ever since staging was introduced I've been having issues where installations or upgrades stopping somewhere near the end and gave an error that the script couldn't execute ./INSTALL. It took me a while but I traced it back to the use of the pkg_add command; apparently it's used to install the created package but without pointing it to a dedicated temporary directory, thus pkg_add defaults to using either /var/tmp or /tmp. Both of which have exec disabled on my system, and so the installation fails. Needless to say but as soon as I specify NO_STAGING on the commandline or in make.conf (which I've been using during upgrade sessions from FreeBSD 9.1 to 9.2 where I rebuild some ports to be sure everything kept working optimally) the whole installation process seems to resort to the previous situation and I get no errors regarding ./INSTALL which can't be executed. Using portmaster or the pkg_info / pkg_version tools also don't show any problems with my package database. Though I could imagine things to be different when using pkgng, I haven't experimented much with that as of yet. As said; I realize that this may not have been intended and it may be ill advised, but at this point this surely seems to be a very effective way to turn staging off. Right now the new stating process gives me more bother than advantages unfortunately. I can understand the theoretical advantages, but fact of the matter is that those don't apply on my situation. With kind regards, Peter -- .\\ S/MIME public key: http://www.catslair.org/pubkey.crt +- My semi-private Root CA: http://ssl.losoco.nl/losoco.crt ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
On 14/10/2013 12:19 AM, Ekkehard Gehm wrote: A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki On Sun, 13 Oct 2013, Ekkehard Gehm wrote something like: Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? My setup is slightly different, where I do use as Matthew recommends, nullfs is used without symlinks; and pkg_* and portmaster are used for the build process. We've been using jails to build ports for different architectures for years, the builds are currently on a FreeBSD 9.2Stable (Built from source on Oct 8) system. Building all ports after a complete wipe, using the portmaster commands fails due to missing file + portmaster
Re: stagedir vs. jail
On 13/10/2013 15:30, Peter Looyenga wrote: I know this method is frowned upon because it's not a method which was intended to be used by end users, but I have to disagree with you here: this setting seems to work flawlessly in disabling staging. Until you try to install a port that has been converted to use staging, when it will likely fail. You're only getting apparent successes at the moment because the staging conversion process has only recently begun. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey signature.asc Description: OpenPGP digital signature
RE: stagedir vs. jail
I know this method is frowned upon because it's not a method which was intended to be used by end users, but I have to disagree with you here: this setting seems to work flawlessly in disabling staging. Until you try to install a port that has been converted to use staging, when it will likely fail. You're only getting apparent successes at the moment because the staging conversion process has only recently begun. I'm also not too sure abou that. When looking at lang/perl5.14 you'll see upon studying it's Makefile that it fully seems to support staging. It doesn't set NO_STAGE, when issueing make build you'll come across the stage directory in the ports work directory, and even in the Makefile itself you'll see it being put to use. For example: post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/perl5/${PERL_VER}/man/man3 @${MKDIR} ${STAGEDIR}${SITE_PERL}/${PERL_ARCH}/auto And yet this is also a good example of a port where a reinstall or updating will fail on my system because of pkg_add being used to install the generated package, which in its turn demands /tmp to have the exec flag set. I'm repeating myself, but forcing NO_STAGE overrides that behavior. However, one thing I do agree with: you're absolutely right that staging is still in the early stages (no pun intended), so I wouldn't be surprised if this behavior got changed somehow in the future. Kind regards, Peter ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: stagedir vs. jail
Yes, this is killing me too. The same: my jails are built by the book: http://www.freebsd.org/doc/handbook/jails-application.html the only difference from the book is, they are located in /jail instead of /home/j which shouldn't matter from the point of view of what is happening inside the jail. Thanks in advance to the bright person(s) who can/will address this! Valeri On Sun, October 13, 2013 8:19 am, Ekkehard Gehm wrote: A quick addition: My Jail is buid exactly as discribed in the jail handbook: http://www.freebsd.org/doc/handbook/jails-application.html So hanging around with this issue because of this staging thing is a bit *argl* Cheers, Ekki On Sun, 13 Oct 2013, Ekkehard Gehm wrote something like: Ahoi! On Sun, 13 Oct 2013, Matthew Seaman wrote something like: On 13/10/2013 11:58, Ekkehard Gehm wrote: I resently have some problems installing/updating ports. The main problem is that the stagedir path is somehow messed up. The system is running FreeBSD 9.1-RELEASE-p6 and I'm working in a jail. While building it creates the stagedir in /s/portbuild/usr/ports/./usr/local/ BUT: When it comes to the pkg building it suddently is looking in .../usr-local/.. witch acctualy is a part of the symlink. (In the jail /usr/local is a symlink to /s/usr-local). Resulting in an failure. The only workiaround is disabling stage completly thru make.conf... As this is very quick'n'dirty I wonder if there is any other solution! Your subject line is (perhaps) a bit misleading: this seems to be nothing specific to the use of jails, but due to having sym-links in various paths. It could happen just the same if you laid out your host filesystem using sym-links. Right. That might be... Anyhow, this looks like a bug to me -- using sym-links to put your filesystem together should not result in chaos. This is alo my understanding of this issue... Are you using pkg(8)? There are differences in the way a package is generated from the staging directory between pkg(8) and pkg_create(1) which might make all the difference. Here is a short cut out of a build (portmaster portmaster): install -o root -g wheel -m 444 /s/portbuild/usr/ports/ports-mgmt/portmaster/wo rk/freebsd-portmaster-7359019/files/bash-completions /s/portbuild/usr/ports/por ts-mgmt/portmaster/work/stage/usr/local/etc/bash_completion.d/portmaster.sh Compressing man pages === Building package for portmaster-3.17.2 Creating package /s/portbuild/usr/ports/ports-mgmt/portmaster/work/portmaster-3. 17.2.tbz Registering depends:. Creating bzip'd tar ball in '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/p ortmaster-3.17.2.tbz' tar: could not chdir to '/s/portbuild/usr/ports/ports-mgmt/portmaster/work/stage /s/usr-local' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. *** [install] Error code 1 Stop in /usr/ports/ports-mgmt/portmaster. === A backup package for portmaster-3.17.1 should be located in /var/ports/packages/portmaster-backup === Installation of portmaster-3.17.2 (ports-mgmt/portmaster) failed === Aborting update === Killing background jobs Terminated === You can restart from the point of failure with this command line: portmaster flags ports-mgmt/portmaster === Exiting As a result portmaster is not working anymore... Is it all ports that are affected? Does the use of PLIST_FILES or PLIST_DIRS in the port Makefile make any difference compared to having a pkg-plist file? A possible work-around: instead of sym-linking /s/usr-local - /usr/local use a nullfs mount instead. mount -t nullfs /s/usr-local /usr/local (Actually, you'ld probably do that from outside the jail so adjust the paths accordingly.) Another workaround: set up your own poudriere instance to build packages for all your jails. poudriere(8) will create its own jails to do package building in, and manage paths etc. itself. It's a natural partner to pkg(8) and zfs(8) but it will work without either of those. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content* PGP-Key: http://www.physik.tu-berlin.de/~gehm/pubkey.asc Experience is what you get when you were expecting something else. Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? FreeBSD:Are you guys coming or what? -- Ekkehard Gehm * mailto:g...@doom-labs.net Doom-Labs Inc. * http://www.doom-labs.net Frag Content*