Manually adding openjdk7

  • Now that I have my installation issue resolved, I am still having trouble actually installing Openjdk7. We have installed it several times on pfSense with the following:

    pkg_add -r

    However, all of a sudden, java will no longer install. It keeps saying "file system full", however when I check the storage, everything seems fine? Disk usage is 13% of 1.8GB

    This is a nano installation. Could that be effecting things differently?

  • i'm not sure, i've not used nano-images, but aren't nano images running on a read-only file-system ?

  • Yes, that is correct. I had to change that temporarily before trying to install java. Then change it back.

  • Here was the read only solution from another thread I posted earlier:

    So it turns out the file system I guess is now mounted read only. Maybe that's just the case with compact flash cards (nano installations). I was able to resolve this with the following:


    Then do the pkg_add install


    This solved the being able to write to the CF card, but it still thinks the filesystem is full and wont let anything install….... UGH!!!!!!!!!

    OpenJDK7 is only approximately 60MB. There must be some other reason why it's preventing it from installing, and the error message just isn't very descriptive.

  • Rebel Alliance Developer Netgate

    FreeBSD 8.1? Are you still running pfSense 2.0.x? You really should upgrade and use the packages from 8.3.

    It fails because it's putting it in /tmp (or perhaps /var) before unpacking/installing. That doesn't work on NanoBSD where that is even more limited in space.

    There are ways around it, poke at the source code for gitsync on that older version for one method.

  • Is this the only solution to install java on a Nano system? Modifying source code is not really a great option. This is not a single test deployment we're trying to do here.

  • Rebel Alliance Developer Netgate

    Unless you have enough RAM to spare that you can increase the size of /tmp and /var, yes.

  • @jimp:

    There are ways around it, poke at the source code for gitsync on that older version for one method.

    I'm having trouble figuring this out. Can you give me a little more direction please. Source code is not very friendly to me.


  • Looks like pkg_add already tries to use multiple locations.

        The value of the PKG_PATH is used if a given package cannot be found.
        The environment variable should be a series of entries separated by
        colons.  Each entry consists of a directory name. The current directory
        may be indicated implicitly by an empty directory name, or explicitly by
        a single period.

    The environment variable PKG_DBDIR specifies an alternative location for
        the installed package database, default location is /var/db/pkg.

    The environment variables PKG_TMPDIR and TMPDIR, in that order, are taken
        to name temporary directories where pkg_add will attempt to create its
        staging area in.  If these variables are not present or if the directo-
        ries named lack sufficient space, then pkg_add will use the first of
        /var/tmp, /tmp or /usr/tmp with sufficient space.

    The environment variable PACKAGEROOT specifies an alternate location for
        pkg_add to fetch from.  The fetch URL is built using this environment
        variable and the automatic directory logic that pkg_add uses when the -r
        option is invoked. An example setting would be "".

    The environment variable PACKAGESITE specifies an alternate location for
        pkg_add to fetch from.  This variable subverts the automatic directory
        logic that pkg_add uses when the -r option is invoked.  Thus it should be
        a complete URL to the remote package file(s).

    The environment variable PKGDIR specifies an alternative location to save
        downloaded packages to when -K option is used.

        /var/tmp   Temporary directory for creating the staging area, if envi-
      ronmental variables PKG_TMPDIR or TMPDIR do not point to a
      suitable directory.
        /tmp   Next choice if /var/tmp does not exist or has insufficient
        /usr/tmp   Last choice if /var/tmp and /tmp are not suitable for creat-
      ing the staging area.
        /var/db/pkg  Default location of the installed package database.

  • Trying to figure out now how to change the size of tmp. Since I have been using the NanoBSD image for 4GB CF, doing the installation myself wasn't an option. Also, every time I have tried to do the install manually, it has failed somehow (and I'm no stranger to installing pfSense). Perhaps I can create a new tmpfs?

  • Rebel Alliance Developer Netgate

    System > Advanced, Misc tab, at the bottom

  • Can that value be easily set/changed via the command line?

  • Unfortunately this does not seem to work. I set /tmp to 100MB. pfSense is running the NanoBSD version (Obviously) on an Alix 2D3 which I believe only has 256MB of memory. I gave it 100MB as I figured this would be enough for a test (Openjdk7 is only about 55MB), but not enough to cause problems (just to try the download). It's still telling me the file system is full.

  • Rebel Alliance Developer Netgate

    It would need to be much larger than that. ALIX wouldn't have enough RAM.

    The technique used b the gitsync script may work (set fs to rw, then use /root/tmp/ for scratch space). It's lot harsher on the CF though.

    I don't imagine you'll have tons of luck running anything Java on an ALIX though, you may want to reconsider how that platform is being put to use.

  • What version in the FTP site should I be using now for pfSense 2.1.4? I never know what to use… A few versions ago it was 8.1. Now there is 8.2, and I don't even see 8.3 anymore... Now 9.0... I hate all these different version jumps.

    Is there a tale somewhere? For example:

    2.0.1 = 8.1
    2.1 = 8.2
    2.1.4 = 9.0

    Those are just examples. idk if those were even correct old versions. I'm so lost...

    Is this the correct link right?

    I ask because I also found this which contains 8.3, 8.4, 9.1, 9.2, Stable versions and current versions.......... SCREW IT

  • Rebel Alliance Developer Netgate

    pfSense 2.1.x uses FreeBSD 8.3, which is no longer supported upstream by FreeBSD (but we maintain our own patches).

    FreeBSD moved the 8.3 files to their ftp-archive server.

  • Therefore I should be using the following correct?

    I chose the link above as the archive server does not list 8.3

  • Ok, little bit of progress (but nothing you probably don't already know)

    I set the ram disks for /tmp and /var to their max and tried to do the download using the following:

    /etc/rc.conf_mount_rw    # Set file system temporarily to read write
    pkg_add -r -v    # Fetch openjdk7

    I set -v so I could watch the process. Last time I tried withhout it and got a "Broken Pipe" error and didn't know what it meant. Watching it closely this time, I noticed it was successfully fetching the package. I was also simultaneously watching the RAM usage. Of course the RAM usage slowly climbed until it maxed out at 100% and crashed. ie "Broken Pipe" error.

    Again, you probably knew all this was going to happen and warned me. I didn't understand how a package of only aprox 55MB could need so much space, but I guess during the staging process, it extracts, maybe duplicates… who knows. Anyways, I guess this confirms now for sure that I cannot use the /tmp /var RAM disks as a solution.

    This means I must force pkg_add to use a different location. You keep telling me to use the gitsync code, but I don't know how to do that. I don't even know where to begin utilizing that source code to help me in this situation. My only next thought process was to either force pkg_add to use some other space via the environment variables, or do a custom install where I increase the size of /tmp at install.

    As for the first method, I tried setting the environment variables TMPDIR and PKG_TMPDIR to point to somewhere else like /root or /mnt (USB drive) using the command below, but it made no change.

    setenv "TMPDIR" "/mnt"
    setenv "PKG_TMPDIR" "/mnt"


    setenv "TMPDIR" "/root"
    setenv "PKG_TMPDIR" "/root"

    Can you please explain your previous suggestion in more detail, or give me some tips on this new potential solution I am trying.

    I wish I didn't have to get JAVA running on ALIX, but it's for work and they're requesting it. Problem is, I have had it working in the past with an older (non nano) version of pfSense, so now they don't understand why all of a sudden I can't get it to work...

    Thank you for your continued support

  • WOOOOOOOOOOOOOT finally got it!

    So I must have had a typo the first go around. Here was the solution:

    /etc/rc.conf_mount_rw    # Set file system temporarily to read write
    setenv "TMPDIR" "/root"    # Set the environment variable so pkg_add uses a location with enough space
    setenv "PKG_TMPDIR" "/root"    # Set the environment variable so pkg_add uses a location with enough space
    pkg_add -r -v    # Fetch openjdk7
    rehash    # Updates executables available in path
    java -version    # Tests whether JAVA is working

    Thank you all for your help

Log in to reply