Home > bash, Linux, Slackware > Slackware install stud 0.3-dev the Scalable TLS Unwrapping Daemon

Slackware install stud 0.3-dev the Scalable TLS Unwrapping Daemon

How to compile the Scalable TLS Unwrapping Daemon

Read the manual here : https://github.com/bumptech/stud

1. get the source in /opt/installs/stud/
install libev if needed : https://github.com/brimworks/libev
get the stud source

you might need to fix the LDFLAGS in the stud Make file :
#LDFLAGS = -lssl -lcrypto -lev -L/usr/local/lib
LDFLAGS = -lssl -lcrypto -lev -L/usr/local/ssl/lib

work log :

root@darkwater:[Mon May 07 08:52:10]:[/opt/installs/stud/libev]$ /bin/sh autogen.sh
root@darkwater:[Mon May 07 08:53:50]:[/opt/installs/stud/libev]$ ./configure
root@darkwater:[Mon May 07 08:54:10]:[/opt/installs/stud/libev]$ make -j3
root@darkwater:[Mon May 07 08:54:21]:[/opt/installs/stud/libev]$ make -j3 install
root@darkwater:[Mon May 07 08:58:08]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ ls
LICENSE  Makefile  README.md  configuration.c  configuration.h  debian/  init.stud*  ringbuffer.c  ringbuffer.h  shctx.c  shctx.h  stud.8  stud.c  version.h
root@darkwater:[Mon May 07 08:58:17]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ make clean
rm -f stud stud.o ringbuffer.o configuration.o
root@darkwater:[Mon May 07 08:58:20]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ make
cc -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include   -c -o stud.o stud.c
cc -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include   -c -o ringbuffer.o ringbuffer.c
cc -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include   -c -o configuration.o configuration.c
cc -o stud stud.o ringbuffer.o configuration.o -lssl -lcrypto -lev -L/usr/local/lib
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld: cannot find -lssl
collect2: ld returned 1 exit status
make: *** [stud] Error 1
root@darkwater:[Mon May 07 09:06:33]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ openssl version
OpenSSL 1.0.0g 18 Jan 2012
root@darkwater:[Mon May 07 09:08:20]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ ls /usr/local/ssl/lib
engines/  libcrypto.a  libssl.a  pkgconfig/
root@darkwater:[Mon May 07 09:17:08]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ emacs Makefile 
root@darkwater:[Mon May 07 09:17:33]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ make
cc -o stud stud.o ringbuffer.o configuration.o -lssl -lcrypto -lev -L/usr/local/ssl/lib
root@darkwater:[Mon May 07 09:17:51]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ make install
install -d /usr/local/bin
install stud /usr/local/bin
install -d /usr/local/share/man/man8
install -m 644 stud.8 /usr/local/share/man/man8
root@darkwater:[Mon May 07 09:17:55]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ stud  --help
stud: error while loading shared libraries: libev.so.4: cannot open shared object file: No such file or directory
root@darkwater:[Mon May 07 09:18:02]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ which stud
root@darkwater:[Mon May 07 09:18:10]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ ldd /usr/local/bin/stud
	linux-gate.so.1 =>  (0xffffe000)
	libev.so.4 => not found
	libc.so.6 => /lib/libc.so.6 (0xb7e5a000)
	libdl.so.2 => /lib/libdl.so.2 (0xb7e56000)
	/lib/ld-linux.so.2 (0xb7fbb000)
root@darkwater:[Mon May 07 09:18:14]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ ldconfig 
root@darkwater:[Mon May 07 09:18:41]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ ldd /usr/local/bin/stud
	linux-gate.so.1 =>  (0xffffe000)
	libev.so.4 => /usr/local/lib/libev.so.4 (0xb7f2f000)
	libc.so.6 => /lib/libc.so.6 (0xb7ded000)
	libdl.so.2 => /lib/libdl.so.2 (0xb7de9000)
	libm.so.6 => /lib/libm.so.6 (0xb7dc2000)
	/lib/ld-linux.so.2 (0xb7f5b000)
root@darkwater:[Mon May 07 09:18:58]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ stud  --help
Usage: stud [OPTIONS] PEM

This is stud, The Scalable TLS Unwrapping Daemon.


        --config=FILE      Load configuration from specified file.
        --default-config   Prints default configuration to stdout.


      --tls                   TLSv1 (default)
      --ssl                   SSLv3 (implies no TLSv1)
  -c  --ciphers=SUITE         Sets allowed ciphers (Default: "")
  -e  --ssl-engine=NAME       Sets OpenSSL engine (Default: "")
  -O  --prefer-server-ciphers Prefer server list order


  -b  --backend=HOST,PORT     Backend [connect] (default is "[]:8000")
  -f  --frontend=HOST,PORT    Frontend [bind] (default is "[*]:8443")


  -n  --workers=NUM          Number of worker processes (Default: 1)
  -B  --backlog=NUM          Set listen backlog size (Default: 100)
  -k  --keepalive=SECS       TCP keepalive on client socket (Default: 3600)


  -r  --chroot=DIR           Sets chroot directory (Default: "")
  -u  --user=USER            Set uid/gid after binding the socket (Default: "root")
  -g  --group=GROUP          Set gid after binding the socket (Default: "root")

  -q  --quiet                Be quiet; emit only error messages
  -s  --syslog               Send log message to syslog in addition to stderr/stdout
  --syslog-facility=FACILITY Syslog facility to use (Default: "daemon")

      --daemon               Fork into background and become a daemon (Default: off)
      --write-ip             Write 1 octet with the IP family followed by the IP
                             address in 4 (IPv4) or 16 (IPv6) octets little-endian
                             to backend before the actual data
                             (Default: off)
      --write-proxy          Write HaProxy's PROXY (IPv4 or IPv6) protocol line
                             before actual data
                             (Default: off)

  -t  --test                 Test configuration and exit
  -V  --version              Print program version and exit
  -h  --help                 This help message
root@darkwater:[Mon May 07 09:20:11]:[/opt/installs/stud/bumptech-stud-a9b5aca]$ stud  -V    
stud 0.3-dev
  1. dragkh
    May 8, 2012 at 10:15 pm

    Slackware stype start-stop-restart script:

    root@darkwater:[Wed May 09 01:12:17]:[/var/log/stud]$ cat /etc/rc.d/rc.stud 
    # /etc/rc.d/rc.stud
    # Start/stop/restart stud 0.3-dev the Scalable TLS Unwrapping Daemon
    # To make stud start automatically at boot, make this
    # file executable:  chmod 755 /etc/rc.d/rc.stud
    if [ ! -d ${stud_log} ]
        mkdir -p ${stud_log}
    chown  -R nobody:nobody ${stud_log}
    cd ${stud_log}
    stud_start() {
      if [ -x ${stud_exe} ]; then
        echo "Starting stud 0.3-dev:  stud -r /tmp -u nobody -g nobody -s -n 2 --ssl -f,9000 -b,5432 -c ALL -B 1000 /etc/ssl/private/stud.pem"
        nohup ${stud_exe} -r /tmp -u nobody -g nobody -s -n 2 --ssl -f,9000 -b,5432 -c ALL -B 1000 /etc/ssl/private/stud.pem & 
        if [ "$(ps ax | grep stud | grep -v grep)" != "" ]
    	echo "the Scalable TLS Unwrapping Daemon has been started"
    stud_stop() {
        ps ax | grep -v grep | grep ${stud_exe} | awk '{print $1}' | xargs -icrap kill crap
        echo "Stopping Scalable TLS Unwrapping Daemon"
        sleep 3
        if [ "$(ps ax | grep stud | grep -v grep)" != "" ]
    	ps ax | grep -v grep | grep ${stud_exe} | awk '{print $1}' | xargs -icrap kill -9 crap
    	sleep 2
            echo "the Scalable TLS Unwrapping Daemon has been terminated"
    stud_restart() {
      sleep 2
    case "$1" in
      # Slackware versions.  This may change to a 'usage' error someday.
    echo "usage $0 start|stop|restart"
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: