Compile server on smartos server

Hi
Im trying to compile the server on smartos server a solaris clone with illumos kernel.
The configure runs fine
When I type make, after a wile I receive this error:
g++ -D_REENTRANT -pthreads -DLINUX -g -O2 -o urbackup_srv AcceptThread.o Client.o Database.o Query.o SelectThread.o Server.o ServerLinux.o ServiceAcceptor.o ServiceWorker.o SessionMgr.o StreamPipe.o Template.o WorkerThread.o main.o md5.o stringtools.o fastcgi.o Mutex_lin.o LoadbalancerClient.o DBSettingsReader.o file_common.o file_fstream.o file_linux.o FileSettingsReader.o LookupService.o SettingsReader.o Table.o OutputStream.o ThreadPool.o MemoryPipe.o Condition_lin.o MemorySettingsReader.o sqlite3.o shell.o SQLiteFactory.o PipeThrottler.o mt19937ar.o DatabaseCursor.o -ldl -lsocket -lnsl
Undefined first referenced
symbol in file
__stack_chk_fail AcceptThread.o
__stack_chk_guard AcceptThread.o
ld: fatal: symbol referencing errors. No output written to urbackup_srv
collect2: error: ld returned 1 exit status
Makefile:524: recipe for target ‘urbackup_srv’ failed
make[2]: *** [urbackup_srv] Error 1
make[2]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:684: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:427: recipe for target ‘all’ failed
make: *** [all] Error 2
[root@owntest ~/urbackup-server-1.4.6]#

I have Gcc 4.9
Do you have any hints to compile it under Solaris
Thank you
Paolo

I wish i could be of more help, and i would love to get URBackup going on SmartOS as well, SmartOS having native ZFS just makes alot of sense for URBackup.

Also i have posted a thread here with a different compile error … I am trying to get UrBackup going in a zone on my setup

Hope we can get this working.

Maybe it’l work with

./configure --disable-fortify

Otherwise (found by googling) does make LDFLAGS=-lssp ?

@c0mputerking1
Some distributions create their own crypto++ makefiles. Perhaps cannibalize the Debian one?

Hi
Now crypto++ is available as cryptopp:
[root@owntest ~/urbackup-server-1.4.6]# pkgin search cryptopp
py27-cryptopp-0.6.0 Python wrapper for (and copy of parts of) crypto++
py26-cryptopp-0.6.0 Python wrapper for (and copy of parts of) crypto++
cryptopp-5.6.2nb2 = Free C++ class library of Cryptographic Primitives

=: package is installed and up-to-date
<: package is installed but newer version is available

: installed package has a greater version than available package
[root@owntest ~/urbackup-server-1.4.6]#

I hope this helps.

Paolo

I tried Both but without success,
I tried also to remove the -DLINUX ifdef flag by removing it from tha Makefile.am and I obtain another error:
file.h:15:3: warning: #warning “using STL file access files>4GB are not supported” [-Wcpp]

warning “using STL file access files>4GB are not supported”

^
mv -f .deps/Server.Tpo .deps/Server.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT ServerLinux.o -MD -MP -MF .deps/ServerLinux.Tpo -c -o ServerLinux.o ServerLinux.cpp
mv -f .deps/ServerLinux.Tpo .deps/ServerLinux.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT ServiceAcceptor.o -MD -MP -MF .deps/ServiceAcceptor.Tpo -c -o ServiceAcceptor.o ServiceAcceptor.cpp
mv -f .deps/ServiceAcceptor.Tpo .deps/ServiceAcceptor.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT ServiceWorker.o -MD -MP -MF .deps/ServiceWorker.Tpo -c -o ServiceWorker.o ServiceWorker.cpp
mv -f .deps/ServiceWorker.Tpo .deps/ServiceWorker.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT SessionMgr.o -MD -MP -MF .deps/SessionMgr.Tpo -c -o SessionMgr.o SessionMgr.cpp
mv -f .deps/SessionMgr.Tpo .deps/SessionMgr.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT StreamPipe.o -MD -MP -MF .deps/StreamPipe.Tpo -c -o StreamPipe.o StreamPipe.cpp
mv -f .deps/StreamPipe.Tpo .deps/StreamPipe.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT Template.o -MD -MP -MF .deps/Template.Tpo -c -o Template.o Template.cpp
mv -f .deps/Template.Tpo .deps/Template.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT WorkerThread.o -MD -MP -MF .deps/WorkerThread.Tpo -c -o WorkerThread.o WorkerThread.cpp
mv -f .deps/WorkerThread.Tpo .deps/WorkerThread.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
mv -f .deps/main.Tpo .deps/main.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT md5.o -MD -MP -MF .deps/md5.Tpo -c -o md5.o md5.cpp
mv -f .deps/md5.Tpo .deps/md5.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT stringtools.o -MD -MP -MF .deps/stringtools.Tpo -c -o stringtools.o stringtools.cpp
mv -f .deps/stringtools.Tpo .deps/stringtools.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT fastcgi.o -MD -MP -MF .deps/fastcgi.Tpo -c -o fastcgi.o test -f 'libfastcgi/fastcgi.cpp' || echo './'libfastcgi/fastcgi.cpp
mv -f .deps/fastcgi.Tpo .deps/fastcgi.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT Mutex_lin.o -MD -MP -MF .deps/Mutex_lin.Tpo -c -o Mutex_lin.o Mutex_lin.cpp
mv -f .deps/Mutex_lin.Tpo .deps/Mutex_lin.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT LoadbalancerClient.o -MD -MP -MF .deps/LoadbalancerClient.Tpo -c -o LoadbalancerClient.o LoadbalancerClient.cpp
mv -f .deps/LoadbalancerClient.Tpo .deps/LoadbalancerClient.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT DBSettingsReader.o -MD -MP -MF .deps/DBSettingsReader.Tpo -c -o DBSettingsReader.o DBSettingsReader.cpp
mv -f .deps/DBSettingsReader.Tpo .deps/DBSettingsReader.Po
g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -pthreads -g -O2 -MT file_common.o -MD -MP -MF .deps/file_common.Tpo -c -o file_common.o file_common.cpp
In file included from file_common.cpp:20:0:
file.h:15:3: warning: #warning “using STL file access files>4GB are not supported” [-Wcpp]

warning “using STL file access files>4GB are not supported”

^
file_common.cpp: In function ‘bool DeleteFileInt(std::string)’:
file_common.cpp:40:34: error: ‘_unlink’ was not declared in this scope
return _unlink(pFilename.c_str())==0?true:false;
^
file_common.cpp: In function ‘bool DeleteFileInt(std::wstring)’:
file_common.cpp:46:57: error: ‘_unlink’ was not declared in this scope
return _unlink(Server->ConvertToUTF8(pFilename).c_str())==0?true:false;
^
Makefile:650: recipe for target ‘file_common.o’ failed
make[2]: *** [file_common.o] Error 1
make[2]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:684: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:427: recipe for target ‘all’ failed
make: *** [all] Error 2

keep trying
Paolo

I solved the previous problem:
in file.h I added on top:

#include <unistd.h>

and I had to rename _unlink functions to unlink
I have another error
file.h:15:3: warning: #warning “using STL file access files>4GB are not supported” [-Wcpp]
mv -f .deps/file_common.Tpo .deps/file_common.Po
g++ -DHAVE_CONFIG_H -I. -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_REENTRANT -pthreads -g -O2 -MT file_fstream.o -MD -MP -MF .deps/file_fstream.Tpo -c -o file_fstream.o file_fstream.cpp
In file included from file_fstream.cpp:20:0:
file.h:15:3: warning: #warning “using STL file access files>4GB are not supported” [-Wcpp]
file_fstream.cpp: In member function ‘bool File::Open(std::wstring, int)’:
file_fstream.cpp:39:21: error: cannot convert ‘const wchar_t*’ to ‘const char*’ for argument ‘1’ to ‘int unlink(const char*)’
file_fstream.cpp: In member function ‘bool File::OpenTemporaryFile(const wstring&, bool)’:
file_fstream.cpp:63:37: error: no matching function for call to ‘File::Open(char*, const int&)’
file_fstream.cpp:63:37: note: candidates are:
file_fstream.cpp:31:6: note: bool File::Open(std::wstring, int)
file_fstream.cpp:31:6: note: no known conversion for argument 1 from ‘char*’ to ‘std::wstring {aka std::basic_string<wchar_t>}’
file_fstream.cpp:55:6: note: bool File::Open(void*)
file_fstream.cpp:55:6: note: candidate expects 1 argument, 2 provided
Makefile:650: recipe for target ‘file_fstream.o’ failed
make[2]: *** [file_fstream.o] Error 1
make[2]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:684: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/root/urbackup-server-1.4.6’
Makefile:427: recipe for target ‘all’ failed
make: *** [all] Error 2

Paolo

Removing that flag on unix systems is not a good idea.

Hi
I compiled finally urbackup on SMARTOS, and it seems to work.
I had to remove the crypto++ dependencies.

I’ll try to make a patch file asap.

Paolo

Hi
I compiled also with the crypto++ but I cannot start the server succesfully
2014-12-18 15:48:06: ERROR: DLL not found: ld.so.1: urbackup_srv: fatal: /lib/liburbackupserver_fsimageplugin.so: open failed: No such file or directory
2014-12-18 15:48:06: ERROR: Loading /lib/liburbackupserver_fsimageplugin.so failed
2014-12-18 15:48:06: ERROR: DLL not found: ld.so.1: urbackup_srv: fatal: /lib/liburbackupserver.so: open failed: No such file or directory
2014-12-18 15:48:06: ERROR: Loading /lib/liburbackupserver.so failed
2014-12-18 15:48:06: ERROR: DLL not found: ld.so.1: urbackup_srv: fatal: /lib/liburbackupserver_httpserver.so: open failed: No such file or directory
2014-12-18 15:48:06: ERROR: Loading /lib/liburbackupserver_httpserver.so failed
2014-12-18 15:48:06: ERROR: Failed binding SOCKET to Port 55413
2014-12-18 15:48:06: ERROR: Error while starting listening to ports. Stopping server.

when I deploy the application with make install i DO NOT HAVE the .so but only .a and .la
I tried also --enable-shared.
Do you have any suggestion ?

Thank you
Paolo

Finally I made it,
urbackup server runs smoothly under Smartos.
I still have to test all functionality.

I had to recompile cryptopp library with -fPIC flag.
I’m trying to make a detailed howto.

Paolo

Ok here it is:

mkdir cryptopp562
cd cryptopp562
wget http://www.cryptopp.com/cryptopp562.zip
unzip cryptopp562.zip
patch -p1 < …/cryptopp562.patch
make all;make install

wget urbackup-server-1.4.6.tar.gz
or download it from sf.
tar zxvf urbackup-server-1.4.6.tar.gz

[root@owntest ~/paolo]# cd urbackup-server-1.4.6
[root@owntest ~/paolo/urbackup-server-1.4.6]# patch -p1 < …/urbackup-server-1.4.6.patch
patching file file_common.cpp
patching file file_fstream.cpp
patching file file_linux.cpp
patching file file.h
patching file httpserver/HTTPProxy.cpp
patching file urbackupserver/fileclient/FileClient.cpp
patching file urbackupserver/server_image.cpp

export LDFLAGS="-lssp -fstack-protector"
export CFLAGS="-fstack-protector -fPIC"
./configure --with-pic ;make all
Patches are in the attached file.
urbackup.7z (1.9 KB)

Paolo

Thank you very much i will be trying this soon, and will post back with my results

In the log file there is a lot of these messages

2014-12-23 14:51:50: WARNING: Filename “filename123.txt” too long. Shortening it.
2014-12-23 14:51:50: WARNING: Filename “filename456.txt” too long. Shortening it.

And in fact, from the web interface, and on the filesystem, all the files have a name like “de-e3fe88f3e3”.

There was probably something wrong with NAME_MAX or _POSIX_NAME_MAX in server_get.cpp when you compiled it.

Hi there is something wrong with NAME_MAX,
if you define NAME_MAX as _POSIX_NAME_MAX, it fixes it to 14, and there is the warning and the truncated files names.

instead if I compile it with
##define NAME_MAX 255

It backups successfully the files with the right name.

Paolo

Thanks Paolo for your howto i added it to my blog (which is a work in progress until i get urbackup working) however i am having trouble getting it to start see the error below

./start_urbackup_server
Info: Snapshot helper not found. Btrfs mode will not work.
Server binary not found
./start_urbackup_server[294]: cd: /usr/var: [No such file or directory]
./start_urbackup_server[296]: exec: /usr/sbin/urbackup_srv: not found

Sorry and know this is probably just me being ignorant and probably just requires me to adjust something in the start_urbackup_server but i really do not know what i am doing with this script and need some help

Seems everything is under “/root/urbackup-server-1.4.7/” somewhere