Installation of a little cli program, impossible?

Status
Not open for further replies.

tachikoma01

Cadet
Joined
Jul 26, 2012
Messages
5
Hi!
I have a little bash script I'm using on my linux computer and I'd like to use it on my freenas NAS. The script is based on lftp (a command line ftp client). The goal of this script is simply to connect to a remote server, check if there's some new file (in a specific directory) since the last check and download the new files.

My problem is I can't install lftp :
1/ I tried with portsnap but portsnap is unknown to freenas.
2/ I downloaded the sources of lftp but when I tried to compile them, I found out there is no c compiler with freenas.

So, is there a way to install lftp?


The fact there is no C compiler and no portsnap available, is it because freenas is based on nanoBSD or has to be limited for 2GB usb key(by the way do you know you can have a 16GB usb3 key for less than 25$ nowadays)?
Is there portsnap or a C compiler available on nas4free?

PS : The downloaded files are moved frequently so I can't just use rsync to make a mirror directory.
PS2 : I am using freenas 8.2 on a 16gb usb stick. (no installation I just let it boot and I used the gui)
 

ben

FreeNAS GUI Developer
Joined
May 24, 2011
Messages
373
Is there any reason you can't just use the plugin jail? Keeping in mind that non-PBI software installed in the plugin jail is lost on jail updates, the jail has far more of the amenities of a FreeBSD system than the outer system does. The plugin jail also supports mountpoints to volumes outside the jail filesystem.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You might also want to try using wget instead of lftp. I think it's already installed on FreeNAS and I think it can handle ftp.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Compile the program with static mode on FreeBSD 8.2. Or grab the FreeBSD package for it, if one is available and there aren't oodles of package dependencies. FreeNAS is just a stripped down FreeBSD. Any standalone executable should generally be runnable on FreeNAS.

wget is reasonably competent at most things, and will not only do ftp, but also ftp via a proxy if needed. However, it is designed a bit differently than a typical ftp client.
 

tachikoma01

Cadet
Joined
Jul 26, 2012
Messages
5
Thank-you for your answers.
Is there any reason you can't just use the plugin jail?
Actually, I want to use the plugin jail if possible. I read the Freenas manual on how to install plugins and I've tried to use the pck_add -r command but I failed, there are 3 dependencies and I can't install them, here is what I

[root@freenas] /mnt/ZFS-RAID-Z/jail/software# pkg_add -r expat
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/expat.tbz... Done.
man/man1/xmlwf.1.gz: Failed to create dir 'man'Can't create 'man/man1/xmlwf.1.gz'
bin/xmlwf: Could not unlink
include/expat.h: Could not unlink
include/expat_external.h: Could not unlink
lib/libexpat.a: Could not unlink
lib/libexpat.la: Could not unlink
lib/libexpat.so: Could not unlink
lib/libexpat.so.6: Could not unlink
tar: Error exit delayed from previous errors.
pkg_add: leave_playpen: can't chdir back to ''


I can't connect with ssh to the jail, so how do I know I'm "in the jail"? Simply by being in the path of my jail when I execute the command?
[root@freenas] /mnt/ZFS-RAID-Z/jail/software# portsnap fetch extract
portsnap: Command not found.


I downloaded the source in tried to compile them in one of the /mnt/ZFS-RAID-Z/jail/software/usr/lftp-4.3.8 directory but no C compiler :

[root@freenas] /mnt/ZFS-RAID-Z/jail/software/usr/lftp-4.3.8# sh ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-freebsd8.2
checking host system type... x86_64-unknown-freebsd8.2
checking for style of include used by make... GNU
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/mnt/ZFS-RAID-Z/jail/software/usr/lftp-4.3.8':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details


I'm going to try to create a PBI package from a PC-BSD 8.2 system and then upload it via the WebGUI.

PS : Sorry but I don't want to use wget for automatic ftp command.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No, a jail is basically a compartmentalized userland. You actually need to start it up, then it essentially does a chdir into the root of the jail, and your jail is running. I don't know enough about the FreeNAS implementation to comment specifically about that. In FreeBSD, jails are started via /etc/rc.d/jail for jails managed by the system, or by the jail command directly for CLI based messing around.
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
You have to remember what freenas is and what it is not.
Freenas is not a general computer system, freenas is a fileserver. ( period)
If you want a general computer with zfs then install freebsd.

As for your demand to run a linux script perodically, fine do that. On a linux box ! ( where the disk(s) might
be mounted from your freenas)
 
Status
Not open for further replies.
Top