UrBackup and FreeNas 8.3

Hi Uroni
i have try to install UrBackup on the new FreeNas 8.3 using the Jail based on FreeBSD 8.3 but i have found some compile error:

software# make
make all-recursive
Making all in .
g++ -DHAVE_CONFIG_H -I. -D_THREAD_SAFE -pthread -DLINUX -g -O2 -MT AcceptThread.o -MD -MP -MF .deps/AcceptThread.Tpo -c -o AcceptThread.o AcceptThread.cpp
In file included from AcceptThread.cpp:23:
stringtools.h:58: error: ‘bool __sbistype’ redeclared as different kind of symbol
/usr/include/_ctype.h:121: error: previous declaration of ‘int __sbistype(__ct_rune_t, long unsigned int)’
stringtools.h:58: error: expected primary-expression before ‘char’
stringtools.h:58: error: expected )' before 'char' stringtools.h:60: error: 'bool __sbistype' redeclared as different kind of symbol /usr/include/_ctype.h:121: error: previous declaration of 'int __sbistype(__ct_rune_t, long unsigned int)' stringtools.h:60: error: expected primary-expression before 'wchar_t' stringtools.h:60: error: expected )’ before ‘wchar_t’
*** Error code 1

Stop in /media/urbackup-server-1.0.
*** Error code 1

Stop in /media/urbackup-server-1.0.
*** Error code 1

Stop in /media/urbackup-server-1.0.

I think UrBackup is very good solution for a Nas appliance like FreeBSD and also post on FreeNas forum ( http://forums.freenas.org/showthread.php?137-Do-You-Have-a-Plugin-Request/page10 ) some UrBackup detail.
Many thanks for your help

Hi,

fixed it for FreeBSD 9.0 here: http://urpc.dyndns.org/urbackup_unstable/urbackup-server-1.0.tar.gz

I had to recompile crypto++ with make CXXFLAGS="-fPIC". Otherwise it wouldn’t link.

getopts does not work as well, i.e., the start_urbackup_server script is broken.

I have only done perfunctory tests on FreeBSD now, so it may not be functional there yet.

Hi Uroni
i will test on FreeNas 8.3 but it is based on FreeBSD 8.3 do you think your workaround is still working?
Thanks

[quote=“dimiz”]Hi Uroni
i will test on FreeNas 8.3 but it is based on FreeBSD 8.3 do you think your workaround is still working?
Thanks[/quote]

Probably. And it’s not just one work around. Had to change quite a lot :).

Hi Uroni
Thanks for your new FreeBSD version! I have compile on FreeNAS 8.3 but as you say i must recompile libcrypto with “-fPIC” option.

/usr/bin/ld: /usr/local/lib/libcryptopp.a(zinflate.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libcryptopp.a: could not read symbols: Bad value
*** Error code 1

Tomorrow i will try to test it.
Regards,

Another option would be to run the configure with the --without-crypto parameter. But then you do not have the internet mode.

[quote=“uroni”]Hi,

fixed it for FreeBSD 9.0 here: http://urpc.dyndns.org/urbackup_unstable/urbackup-server-1.0.tar.gz

I had to recompile crypto++ with make CXXFLAGS="-fPIC". Otherwise it wouldn’t link.

getopts does not work as well, i.e., the start_urbackup_server script is broken.

I have only done perfunctory tests on FreeBSD now, so it may not be functional there yet.[/quote]

Hi Uroni
i have try to compile from the tar ball crypto++ 5.6.1 on my freebsd but is not working as usually (configure,make,make install) i have the error “no target to make”, can you give me some hits on compile?
many thanks

Well, I just wen to ports/cryptopp (was already on my system) and did a make CXXFLAGS="-fPIC" there, plus make install. I think the Makefile there is modified for FreeBSD.

Thanks for your hits, without your help i can’t go on!
From the FreeNas Jail i have do:

  • cd /usr/ports/secure/cryptopp
  • make
  • make install
    the install script ask for a user and i follow the user creation using you command as prototype (on freebsd the linux “useradd” seems dont like)

so i try to start the UrBackup Daemon but without init script i have to find how i can launch it, viewing the Debian versions i have found “/usr/local/sbin/start_urbackup_server”, eureka!! :-)
But…

/usr/local/sbin/urbackup_srv --plugin /usr/local/lib/liburbackupserver_urlplugin.so --plugin /usr/local/lib/liburbackupserver_cryptoplugin.so --plugin /usr/local/lib/liburbackupserver_downloadplugin.so --plugin /usr/local/lib/liburbackupserver_fsimageplugin.so --plugin /usr/local/lib/liburbackupserver_httpserver.so --plugin /usr/local/lib/liburbackupserver.so --http_root /usr/local/var/urbackup/www --workingdir /usr/local/var --user urbackup
2012-11-06 10:48:33: done.
2012-11-06 10:48:33: Loaded -url- plugin
2012-11-06 10:48:33: Loaded -cryptoplugin- plugin
2012-11-06 10:48:33: Loaded -download- plugin
2012-11-06 10:48:33: Loaded -fsimageplugin- plugin
2012-11-06 10:48:33: Starting HTTP-Server on port 80
2012-11-06 10:48:33: ERROR: HTTP: Failed binding SOCKET to Port 80
2012-11-06 10:48:33: Generating Server identity…
2012-11-06 10:48:33: Generating Server token…
2012-11-06 10:48:33: Could not open db [urbackup/backup_server.db]
2012-11-06 10:48:33: ERROR: Database “urbackup/backup_server.db” couldn’t be opened
Segmentation fault

The DB file seems with good permission:

software# ll /usr/local/var/urbackup/backup_server.db
-rwxrwxrwx 1 urbackup urbackup 22528 Nov 6 10:42 /usr/local/var/urbackup/backup_server.db

Sorry for my boring question :-) but can you still give me some help?
Many thanks!

It searches in the working dir for the database.

I had to
cd /usr/local/var
and then start it.
With the paramter --http_port 55414 you can start it on another http port.
I think I fixed it but make sure the urbackup user has “x” permission on /usr/local/var/urbackup (chmod +x /usr/local/var/urbackup)

Yes as you usually your are right!!
I must start UrBackup from the " /usr/local/var" very strange i supposed because i put the long path inside the start command below:

/usr/local/sbin/urbackup_srv --plugin /usr/local/lib/liburbackupserver_urlplugin.so --plugin /usr/local/lib/liburbackupserver_cryptoplugin.so --plugin /usr/local/lib/liburbackupserver_downloadplugin.so --plugin /usr/local/lib/liburbackupserver_fsimageplugin.so --plugin /usr/local/lib/liburbackupserver_httpserver.so --plugin /usr/local/lib/liburbackupserver.so --http_root /usr/local/var/urbackup/www --workingdir /usr/local/var --user urbackup --http_port 55414

But now it work!! Thanks i will report how it works
Many thanks

HowTo Install UrBackup on FreeNAS 8.3 Jail

I don’t write how to configure a Jail on FreeNAS beacuse there are a good docuemntation on Documentation Redirect

Below everything you need to start your UrBackup Software!

Download latest Urbackup-Server

wget http://urpc.dyndns.org/urbackup_unstable/urbackup-server-1.0.tar.gz

Fetch ports for Freenas because with need lib crypto++ with option “-fPIC”:

portsnap fetch extract

Compile the library:

cd /usr/ports/security/cryptopp
make CXXFLAGS=“-fPIC”
make install

Install Curl

pkg_add -r curl

Extract the urbackup-server-1.0.tar.gz

tar zxvf urbackup-server-1.0.tar.gz
cd urbackup-server
./configure
make
make install

The UrBackup “make install” on linux works well but on FreeNAS ask about creation of the “urbackup” user so is not difficult we only specify some option like:

  • Defualt home: /usr/local/var/urbackup
  • Username: urbackup
  • Password: no password

Now we are done!

To start UrBackup server:

cd /usr/local/var
/usr/local/sbin/urbackup_srv --plugin /usr/local/lib/liburbackupserver_urlplugin.so --plugin /usr/local/lib/liburbackupserver_cryptoplugin.so --plugin /usr/local/lib/liburbackupserver_downloadplugin.so --plugin /usr/local/lib/liburbackupserver_fsimageplugin.so --plugin /usr/local/lib/liburbackupserver_httpserver.so --plugin /usr/local/lib/liburbackupserver.so --http_root /usr/local/var/urbackup/www --workingdir /usr/local/var --user urbackup --http_port 55414


Simple Init Script

vi /etc/rc.d/urbackup_srv

file: urbackup_srv (Write the script start after “----” to “----”

#!/bin/sh

. /etc/rc.subr

name=urbackup_srv
rcvar=urbackup_srv_enable

command=“/usr/local/sbin/${name}”
command_args=“–plugin /usr/local/lib/liburbackupserver_urlplugin.so --plugin /usr/local/lib/liburbackupserver_cryptoplugin.so --plugin /us
r/local/lib/liburbackupserver_downloadplugin.so --plugin /usr/local/lib/liburbackupserver_fsimageplugin.so --plugin /usr/local/lib/liburbac
kupserver_httpserver.so --plugin /usr/local/lib/liburbackupserver.so --http_root /usr/local/var/urbackup/www --workingdir /usr/local/var –
user urbackup --http_port 55414 --logfile /var/log/urbackup_srv.log”

start_precmd=“cd /usr/local/var”

load_rc_config $name
run_rc_command “$1”

Give the Executable permission

chmod +x /etc/rc.d/urbackup_srv

Edit the Autostart file “/etc/rc.conf” and add the line:

urbackup_srv_enable=“YES”


Many thanks to URONI for helping and developing this very good piece of software

Cool. Thx. Are you using this extensively yet? There may be issues with UrBackup using up a lot of space in /tmp .

Thanks to Uroni
at the moment i don’t have used so much but on saturday i want install in my office to stress it, I also read about “tmp” problem so i create a big TMP :-)

PS: About “Restore” functionality of UrBackup, have you some idea to extend it from WebGui or from Client side? I ask it because sometimes the simple user want restore a directory to the old path and he don’t like go to the web page but this is my point of view.

Thanks for your great work!