How to install PostgreSQL 9.3 in FreeBSD jail?

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

How to install PostgreSQL 9.3 in FreeBSD jail?

Postby eonil » 07 Oct 2013, 15:54

Hello. I am newbie on this forum. I am not sure that I can ask a question like this, but if this doesn't fit here, please let me know, then I will handle it.

I was trying to configure a PostgreSQL server in a jail. I configured virtual NICs using PF, and a jail for FreeBSD using [CMD]qjail create pgsql-jail 192.168.0.3[/CMD].

When I tried to install PostgreSQL 9.3 using port collection, it shows strange message at first.

Code: Select all
pgsql-jail /usr/ports/databases/postgresql93-server >make install
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.5_1
===> Skipping 'config' as NO_DIALOG is defined
====> You must select one and only one option from the KRB5 single
*** [check-config] Error code 1

Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.
*** [install] Error code 1

Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.
===> Options unchanged
=> postgresql-9.3.0.tar.bz2 doesn't seem to exist in /var/ports/distfiles/postgresql.
=> Attempting to fetch [url]ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/source/v9.3.0/postgresql-9.3.0.tar.bz2[/url]
postgresql-9.3.0.tar.bz2                        1% of   16 MB   71 kBps



Anyway, installation continues, so I waited. I chose all default options for all option dialogs. And at the end of the process, I saw it finally failed with this message.

Code: Select all
====> Compressing man pages
===>  Building package for pkgconf-0.9.3
Creating package /basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz
Registering depends:.
Registering conflicts: pkg-config-*.
Creating bzip'd tar ball in '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz'
tar: Failed to open '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz'
pkg_create: make_dist: tar command failed with code 256
*** [do-package] Error code 1

Stop in /basejail/usr/ports/devel/pkgconf.
*** [build-depends] Error code 1

Stop in /basejail/usr/ports/textproc/libxml2.
*** [install] Error code 1

Stop in /basejail/usr/ports/textproc/libxml2.
*** [lib-depends] Error code 1

Stop in /basejail/usr/ports/databases/postgresql93-server.
*** [install] Error code 1

Stop in /basejail/usr/ports/databases/postgresql93-server.



I have no idea why this fails. Errors at beginning seems I have something wrong with [FILE]dialog4ports[/FILE]. And errors at last seems installer cannot write to ports file tree. AFAIK, the ports files are read-only shared from host system.

What's wrong with my jail? How can install PostgreSQL 9.3 in my jail?


P.S. I cross-posted this question to http://unix.stackexchange.com/questions/93946/how-to-install-postgresql-9-3-in-freebsd-jail I hope cross-posting is not a violation manner in this forum...
eonil
Junior Member
 
Posts: 16
Joined: 23 Sep 2013, 01:44

Postby neolix » 10 Oct 2013, 10:42

This is an issue to do with a change in how the port system handles the install target. You have two choices:
  1. Update [FILE]qjail[/FILE] if there is a newer version or wait until the maintainer creates a fix. You could also email them to let them know.
  2. As a temporary measure, execute [Cmd]mkdir -p /var/ports/packages[/cmd] in the jail, and then attempt to install PostgreSQL.
neolix
Junior Member
 
Posts: 27
Joined: 21 Nov 2012, 19:55

Postby eonil » 14 Oct 2013, 05:58

Unfortunately, I couldn't find regular way to contact the author... The sourceforge forum/mailing list was empty.
eonil
Junior Member
 
Posts: 16
Joined: 23 Sep 2013, 01:44

Postby ShelLuser » 14 Oct 2013, 11:55

Now, I have no experience with [file]qjail[/file] at all, but it looks to me as if those commands are not running in a jail but more so on the host system, which could explain a thing or two.

If this is a regular jail I'd use [file]jls[/file] to check its details and then [file]jexec[/file] to run a command inside that jail, a shell for example. Then you should be able to install those ports in the same way you'd install a port on any other FreeBSD system.
User avatar
ShelLuser
Member
 
Posts: 992
Joined: 17 Apr 2013, 03:43
Location: Netherlands

Postby neolix » 15 Oct 2013, 07:01

@[user]eonil[/user], did you attempt the second option, creating the [FILE]/var/ports/packages[/FILE] directory in the jail and then running [CMD]make install[/CMD] again?
neolix
Junior Member
 
Posts: 27
Joined: 21 Nov 2012, 19:55

Postby eonil » 16 Oct 2013, 03:31

[user]neolix[/user],

I am sorry, I didn't. Because I have too much works to do, so I couldn't invest too much time on research, and had to move on. I will test as soon as I can.

In addition, someone posted a workaround on the SE site, which to install [file]dialog4ports[/file] first.
http://unix.stackexchange.com/questions/93946/how-to-install-postgresql-9-3-in-freebsd-jail/96205?noredirect=1#96205.
eonil
Junior Member
 
Posts: 16
Joined: 23 Sep 2013, 01:44


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: martino and 3 guests