http://www.perlmonks.org?node_id=1020374

gideondsouza has asked for the wisdom of the Perl Monks concerning the following question:

See Update below.
I've been hacking and upto no good with this project here: www.tryperl.com. It's a learning project and I'm a newbie. I've been posting prolifically about it for some time.

I'm trying to create a better virtual environment to run a users perl code, so my objective is this:

I have perl and starman installed on my freebsd machine. I want to copy this installation into a another freebsd machine which is completely offline/disconnected from the internet.

Q: Is it as simple as a few directory copies? What about installing perl on the command line?

This other system is a freebsd jail. I've been trying day and night to run the jail, unfortunately I cannot get the jail connected to the internet to install modules directly. Since I'm going to disconnected it later anyway I was thinking about just installing everything I need on the host system and then copy it into the jail.

Thorough help with be appreciated with credits on tryperl.com :)

Update: Ok I'm halfway there. I figured I have to do the following for perl, right? Instead of $HOME/localperl can I just say /jails/myjail/usr/bin/perl ?:

wget http://www.cpan.org/src/5.0/perl-5.16.2.tar.gz tar -xzf perl-5.16.2.tar.gz cd perl-5.16.2 ./Configure -des -Dprefix=$HOME/localperl make make test make install

Now what about Starman? Can I copy it from a directory? If I install from source I will have to manually install it's dependencies

Replies are listed 'Best First'.
Re: copy perl ... OT
by ww (Archbishop) on Feb 24, 2013 at 12:41 UTC
    Good that you're aware of using a jail; suggest that your next improvement be a system of moderating the AnonyUser updates before they're public and providing (requiring!) meaningful titles.

    IMO, that list list of "untitled.pl" scripts is something a reasonably cautious individual would spot and run from.

    And, please, use PM markup -- your link is borked!


    If you didn't program your executable by toggling in binary, it wasn't really programming!

Re: copy perl and some modules into an offline OS (copy)
by Anonymous Monk on Feb 24, 2013 at 07:45 UTC

    so , install starman into your perl tree, so when you copy perl, starman gets copied

    for any gnu/autotools sofware, they all take prefix=, as in  sh configure prefix=$HOME/yams

Re: copy perl and some modules into an offline OS
by gideondsouza (Pilgrim) on Feb 24, 2013 at 08:21 UTC

    Ok so I'm currently installing perl like this:

    ./Configure -des -Dprefix=/usr/jails/basejail/myjail/usr/bin

    My question is where do I copy starman from? In addition to the directory I need to also copy other dependencies right? So what folder should I copy? Where is the default cpan module directory?

      You're doing things backwards

      use a root prefix, like /inside

      build all your stuff relative to /inside, all the software

      then make a jail ANYWHERE

      then copy /inside into jail

      inside the jail treat /inside as root

      or if you want /usr/bin .. instead of /inside/usr/bin

      start copying /usr/bin ... into your jail

      then go to jail, switch to jail, chroot to your jail ,

      then install perl as normal into whatever place inside the jail, using absolute jail paths

      see links for chroot setup

Re: copy perl and some modules into an offline OS
by topher (Scribe) on Feb 26, 2013 at 00:10 UTC

    What if you use perlbrew to install the perl environment? I seem to recall a co-worker making heavy use of perlbrew/App::perlbrew + local::lib to setup a perl environment and build a custom app that he could easily tarball up and move to an offline server.

    From what I remember him saying, the combination of tools made the whole thing a snap.

Re: copy perl and some modules into an offline OS
by gideondsouza (Pilgrim) on Feb 26, 2013 at 15:53 UTC

    Thanks for all your replies guys.

    I've been working my butt off and I FreeBSD jails was no good with my lack of vast unix experience, however I explored linux containers and got them to work and everything.

    Stuff should be up and running soon