Version 1 (modified by armin, 3 years ago)

Add infinoted build instructions for Solaris 10

Build infinoted on Solaris 10

The following is a complete description for building and configuring the "infinoted" (Gobby server) under Solaris 10 x86-64.

The daemon will be run in a dedicated non-global zone. We'll build everything from the sources.

Make sure you've got some GNU tools ready:

  • /usr/sfw/bin/wget
  • /usr/sfw/bin/gtar
  • /usr/sfw/bin/gmake
  • /usr/sfw/bin/gcc
# gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Environment Setup

Non-global Zone

# zlogin ex1
# groupadd gobby
# useradd -g gobby -s /usr/bin/bash -m gobby
# passwd
# mkdir /opt/local

Add the following to /etc/profile:

PATH=/opt/local/bin:${PATH}
export PATH

LD_LIBRARY_PATH=/opt/local/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

Finally run this so that the changes to /etc/profile take effect:

# source /etc/profile

Build Software

Global Zone

Fetch the tarballs of the packages we need to build:

# cd /export/home/software/tarballs
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
# wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
# wget http://ftp.gnome.org/pub/gnome/sources/glib/2.22/glib-2.22.4.tar.gz
# wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
# wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2
# wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.5.tar.gz
# wget http://ftp.gnu.org/pub/gnu/gnutls/gnutls-2.8.5.tar.bz2
# wget http://alpha.gnu.org/gnu/gsasl/libgsasl-1.4.0.tar.gz
# wget http://0pointer.de/lennart/projects/libdaemon/libdaemon-0.14.tar.gz
# wget http://releases.0x539.de/libinfinity/libinfinity-0.4.1.tar.gz

Non-global Zone

# zlogin ex1

libiconv

# cd /tmp
# gtar xvzf /export/home/software/tarballs/libiconv-1.13.1.tar.gz
# cd libiconv-1.13.1
# ./configure --prefix=/opt/local
# gmake
# gmake install

pkg-config

# cd /tmp
# gtar xvzf /export/home/software/tarballs/pkg-config-0.23.tar.gz
# cd pkg-config-0.23
# ./configure --prefix=/opt/local
# gmake
# gmake install

glib

# cd /tmp
# gtar xvzf /export/home/software/tarballs/glib-2.22.4.tar.gz
# cd glib-2.22.4
# ./configure --prefix=/opt/local --with-libiconv=gnu
# gmake
# gmake install

libxml2

Note: The newer release version libxml2-2.7.6.tar.gz fails to build, since it appears to use GNU linker specific feature, not available with the Solaris platform linker. See

> http://gcc.gnu.org/ml/gcc-help/2009-09/msg00184.html
> http://gcc.gnu.org/ml/gcc-help/2009-09/msg00185.html
> 
> "I would guess that libxml2 is using GNU style symbol versioning 
> which is an extension of Solaris symbol versioning.  If there is no 
> way to disable symbol versioning for libxml2, then you probably need 
> to use the GNU linker here."

We just use a slightly older version of libxml2 which doesn't use GNU specifica, so that we can use the Solaris platform linker.

# cd /tmp
# gtar xvzf /export/home/software/tarballs/libxml2-2.7.3.tar.gz
# cd libxml2-2.7.3
# ./configure --prefix=/opt/local
# gmake
# gmake install

libgpg-error

# cd /tmp
# gtar xvjf /export/home/software/tarballs/libgpg-error-1.7.tar.bz2
# cd libgpg-error-1.7
# ./configure --prefix=/opt/local
# gmake
# gmake install

libgcrypt

# cd /tmp
# gtar xvzf /export/home/software/tarballs/libgcrypt-1.4.5.tar.gz
# cd libgcrypt-1.4.5
# ./configure --prefix=/opt/local
# gmake
# gmake install

gnutls

# cd /tmp
# gtar xvjf /export/home/software/tarballs/gnutls-2.8.5.tar.bz2
# cd gnutls-2.8.5
# ./configure --prefix=/opt/local --disable-kerberos_v5 --disable-gssapi

Apply Patch 1, which fixes a GCC 3.4.3 bug (see: http://old.nabble.com/On-dropping--D_REENTRANT--D_THREAD_SAFE-td14620552.html):

--- src/cfg/shared.c.orig       Fri Feb 26 10:18:50 2010
+++ src/cfg/shared.c    Fri Feb 26 10:19:33 2010
@@ -58,6 +58,7 @@
 #include <platon/str/strplus.h>
 #include <platon/str/strdyn.h>

+#define HUGE_VAL (__builtin_huge_val())
 #include "cfg+.h"
 /* }}} */

Apply Patch 2 (workaround, we don't need docs/examples anyway):

--- doc/examples/Makefile.orig  Fri Feb 26 10:20:15 2010
+++ doc/examples/Makefile       Fri Feb 26 10:21:29 2010
@@ -822,7 +822,8 @@
        ex-rfc2818.c ex-session-info.c ex-x509-info.c ex-verify.c       \
        tcp.c

-all: all-am
+all:
+       echo

 .SUFFIXES:
 .SUFFIXES: .c .cpp .lo .o .obj
@@ -1085,7 +1086,8 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
 installdirs:
-install: install-am
+install:
+       echo
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am

Finally go ahead with compilation:

# gmake
# gmake install

libgsasl

# cd/tmp
# gtar xvzf /export/home/software/tarballs/libgsasl-1.4.0.tar.gz
# cd libgsasl-1.4.0
# ac_cv_func_memchr=no gl_cv_func_memchr_works=no ./configure --prefix=/opt/local --disable-gssapi
# gmake
# gmake install

libdaemon

# cd/tmp
# gtar xvzf /export/home/software/tarballs/libdaemon-0.14.tar.gz
# cd libdaemon-0.14
./configure --prefix=/opt/local
# gmake
# gmake install

libinfinity

# cd/tmp
# gtar xvzf /export/home/software/tarballs/libinfinity-0.4.1.tar.gz
# cd libinfinity-0.5.0
# ./configure --prefix=/opt/local

Make sure infinoted is built and libdaemon is available, by checking the configure output. The following is supposed to appear:

Build optional packages:
  libinfgtk: no
  libinftextgtk: no
  infinoted: yes

Enable support for:
  avahi: no
  libdaemon: yes

Finally build it:

# gmake
# gmake install
# cd /opt/local/bin/
# ln -s infinoted-0.4 infinoted

Configure Daemon

Check that things are set up correctly:

[root@tavo1g:~]$ zoneadm -z ex1 reboot
[root@tavo1g:~]$ zlogin -l gobby ex1
[Connected to zone 'ex1' pts/3]
Last login: Fri Feb 26 09:42:44 on pts/3
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ which infinoted
/opt/local/bin/infinoted
-bash-3.00$ ldd /opt/local/bin/infinoted
        libinftext-0.5.so.0 =>   /opt/local/lib/libinftext-0.5.so.0
        libinfinity-0.5.so.0 =>  /opt/local/lib/libinfinity-0.5.so.0
        libgobject-2.0.so.0 =>   /opt/local/lib/libgobject-2.0.so.0
        libgmodule-2.0.so.0 =>   /opt/local/lib/libgmodule-2.0.so.0
        libglib-2.0.so.0 =>      /opt/local/lib/libglib-2.0.so.0
        libxml2.so.2 =>  /opt/local/lib/libxml2.so.2
        libpthread.so.1 =>       /lib/libpthread.so.1
        libiconv.so.2 =>         /opt/local/lib/libiconv.so.2
        libm.so.2 =>     /lib/libm.so.2
        libnsl.so.1 =>   /lib/libnsl.so.1
        libgnutls.so.26 =>       /opt/local/lib/libgnutls.so.26
        libz.so.1 =>     /usr/lib/libz.so.1
        libgsasl.so.7 =>         /opt/local/lib/libgsasl.so.7
        libgcrypt.so.11 =>       /opt/local/lib/libgcrypt.so.11
        libgpg-error.so.0 =>     /opt/local/lib/libgpg-error.so.0
        libsocket.so.1 =>        /lib/libsocket.so.1
        libpam.so.1 =>   /lib/libpam.so.1
        libdaemon.so.0 =>        /opt/local/lib/libdaemon.so.0
        libc.so.1 =>     /lib/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libcmd.so.1 =>   /lib/libcmd.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
-bash-3.00$

-bash-3.00$ file `which infinoted`
/opt/local/bin/infinoted:       ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped
-bash-3.00$

Create document root / server key/certificate

You can choose another filename for the key and/or certificate of course.

# zlogin -l gobby ex1
# mkdir /home/gobby/documents
# chmod 700 /home/gobby/documents
# openssl genrsa -out gobby.tavendo.de.key 2048
# chmod 400 gobby.tavendo.de.key
# openssl req -new -key gobby.tavendo.de.key -x509 -days 1095 -out gobby.tavendo.de.crt

Then tell it what it wants to know and you end up with a newly created certificate.

Manual start

To start the daemon, run

# zlogin -l gobby ex1
# /opt/local/bin/infinoted --security-policy=require-tls --key-file=/home/gobby/gobby.tavendo.de.key --certificate-file=/home/gobby/gobby.tavendo.de.crt

Automatic start

The following is just a quick hack start/stop script .. but it does the job.

Create a script in /home/gobby/gobbyctl with the following content:

#!/bin/sh

ARGV="$@"

ERROR=0

case $ARGV in
start)
    su - gobby -c "/opt/local/bin/infinoted -D"
    su - gobby -c "/opt/local/bin/infinoted \
                     --daemonize \
                     --security-policy=require-tls \
                     --key-file=/home/gobby/gobby.tavendo.de.key \
                     --certificate-file=/home/gobby/gobby.tavendo.de.crt \
                     --root-directory=/home/gobby/documents/ \
                     --autosave-interval=5 \
                     --password=XXXXXXXX"
    ERROR=$?
    ;;
stop)
    su - gobby -c "/opt/local/bin/infinoted -D"
    ERROR=$?
    ;;
*)
    echo "usage: gobbyctl start | stop"
    ERROR=$?
esac

exit $ERROR

Make it executable:

# chmod 700 gobbyctl

Make it start/stop automatically:

# zlogin gobby ex1
# ln -s /home/gobby/gobbyctl /etc/rc0.d/K01gobby
# ln -s /home/gobby/gobbyctl /etc/rc3.d/S99gobby
# exit
# zoneadm -z ex1 reboot

Configuration File

If you are worried about the password being provided on the command line then you can also use a configuration file as described in Infinote/Infinoted.