FreeBSD101: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:




Install snappy from ports
'''Install snappy from ports'''
  cd /usr/ports/archivers/snappy
  cd /usr/ports/archivers/snappy
  make install
  make install




Install rrdtool from package
'''Install rrdtool from package'''
  pkg install rrdtool
  pkg install rrdtool




Download and configure voipmonitor
'''Download and configure voipmonitor'''
  cd /usr/src
  cd /usr/src
  git clone https://github.com/voipmonitor/sniffer.git
  git clone https://github.com/voipmonitor/sniffer.git
Line 33: Line 33:




update your files db and locate ansidecl.h in your gcc plugins and copy it to voipmonitor sources dir
'''update your files db and locate ansidecl.h in your gcc plugins and copy it to voipmonitor sources dir'''
  /usr/libexec/locate.updatedb
  /usr/libexec/locate.updatedb
  locate ansidecl.h //returned /usr/local/lib/gcc48/gcc/i386-portbld-freebsd10.0/4.8.3/plugin/include/ansidecl.h
  locate ansidecl.h //returned /usr/local/lib/gcc48/gcc/i386-portbld-freebsd10.0/4.8.3/plugin/include/ansidecl.h
Line 39: Line 39:




Create links for default Makefile names
'''Create links for default Makefile names'''
  ln -s /usr/bin/c++ /usr/sbin/g++
  ln -s /usr/bin/c++ /usr/sbin/g++
  ln -s /usr/local/bin/gcc48 /usr/local/bin/gcc
  ln -s /usr/local/bin/gcc48 /usr/local/bin/gcc




I was unable to say to ldconfig, where are my new shared files located. As a temporary workaround, I created symlinks. If you know better way, how to done it, please let me know at: petr.halounek@voipmonitor.org)
''I was unable to say to ldconfig, where are my new shared files located. As a temporary workaround, I created symlinks. If you know better way, how to done it, please let me know at: petr.halounek@voipmonitor.org)''




Modify Makefile (remove all -ldl, rewrite json to json-c)
'''Modify Makefile (remove all -ldl, rewrite json to json-c)'''
  sed -i.orig s/\ \-ldl// Makefile
  sed -i.orig s/\ \-ldl// Makefile
  sed -i.bak s/\ json/\ json-c/g Makefile
  sed -i.bak s/\ json/\ json-c/g Makefile




Add options for linking into Makefile after shared: cleantest $(objects) should be:
'''Add options for linking''' into Makefile after shared: cleantest $(objects) should be:
  ${CXX} -v -Xlinker --allow-multiple-definition $(objects) ${CXXFLAGS} -o voipmonitor ${LIBS} ${LIBS_PATH}
  ${CXX} -v -Xlinker --allow-multiple-definition $(objects) ${CXXFLAGS} -o voipmonitor ${LIBS} ${LIBS_PATH}




Compile voipmonitor
'''Compile voipmonitor'''
  gmake
  gmake
  gmake install
  gmake install




Create voipmonitor startup script
'''Create voipmonitor startup script'''
  echo voipmonitor_enable=\"YES\" >> /etc/rc.conf
  echo voipmonitor_enable=\"YES\" >> /etc/rc.conf
  vi /usr/local/etc/rc.d/voipmonitor
  vi /usr/local/etc/rc.d/voipmonitor

Revision as of 11:14, 27 January 2015

note:tested on 32bit release with voipmonitor 11 sources


Install packages

pkg install libexecinfo libpcap unixODBC mysql56-client libvorbis libogg vorbis-tools gmake subversion wget bash libssh git mysql56-server autotools


Startup mysql

echo mysql_enable=\"YES\" >> /etc/rc.conf
vim /var/db/mysql/my.cnf 
service mysql-server start


Install json-c from ports

cd /usr/ports/devel/json-c
make install


Install snappy from ports

cd /usr/ports/archivers/snappy
make install


Install rrdtool from package

pkg install rrdtool


Download and configure voipmonitor

cd /usr/src
git clone https://github.com/voipmonitor/sniffer.git
cd sniffer
./configure


update your files db and locate ansidecl.h in your gcc plugins and copy it to voipmonitor sources dir

/usr/libexec/locate.updatedb
locate ansidecl.h //returned /usr/local/lib/gcc48/gcc/i386-portbld-freebsd10.0/4.8.3/plugin/include/ansidecl.h
cp /usr/local/lib/gcc48/gcc/i386-portbld-freebsd10.0/4.8.3/plugin/include/ansidecl.h ansidecl.h


Create links for default Makefile names

ln -s /usr/bin/c++ /usr/sbin/g++
ln -s /usr/local/bin/gcc48 /usr/local/bin/gcc


I was unable to say to ldconfig, where are my new shared files located. As a temporary workaround, I created symlinks. If you know better way, how to done it, please let me know at: petr.halounek@voipmonitor.org)


Modify Makefile (remove all -ldl, rewrite json to json-c)

sed -i.orig s/\ \-ldl// Makefile
sed -i.bak s/\ json/\ json-c/g Makefile


Add options for linking into Makefile after shared: cleantest $(objects) should be:

${CXX} -v -Xlinker --allow-multiple-definition $(objects) ${CXXFLAGS} -o voipmonitor ${LIBS} ${LIBS_PATH}


Compile voipmonitor

gmake
gmake install


Create voipmonitor startup script

echo voipmonitor_enable=\"YES\" >> /etc/rc.conf
vi /usr/local/etc/rc.d/voipmonitor
#!/bin/sh
#
#
# PROVIDE: voipmonitor
# REQUIRE: mysql
# KEYWORD: shutdown
#
. /etc/rc.subr
name=voipmonitor
rcvar=voipmonitor_enable
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
pidfile="/var/run/${name}.pid"
procname="/usr/sbin/voipmonitor"
start_cmd="/usr/sbin/voipmonitor --config-file=/etc/voipmonitor.conf -v1"
load_rc_config $name
run_rc_command "$1"
ldconfig
service voipmonitor start