User Tools

Site Tools


acdsn:daemon_installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
acdsn:daemon_installation [2012/08/21 17:03] – created sbolayacdsn:daemon_installation [2012/10/03 10:02] (current) – [For a complete installation of the acdsn server] sbolay
Line 3: Line 3:
 It first listen to the RS485 network and if there is no backup master (slave)  It first listen to the RS485 network and if there is no backup master (slave) 
 this daemon will take the hand! this daemon will take the hand!
- 
  
 ===== For a complete installation of the acdsn server ===== ===== For a complete installation of the acdsn server =====
-  - Install packages (aptitude update && aptitude install automake make libtool flex byacc bison g++ libldap2-dev texinfo) +  - ssh to the [[http://www.acmesystems.it/FOXG20|FoxG20]] box and login (root/netusg20) 
-  - Compile and install libconfig (./configure && make && make install) +  - update the debian source-list with your favorite debian package mirror<code bash> 
-  - Reload libraries (ldconfig) +    vi /etc/apt/source.list</code> 
-  - Configure compile and install acdsn (-DACCESS or -DCONTROL or -DDRIVE in Makefile.am and then ./configure && make && make install) +  - keep the server on time to avoid time stamp error<code bash> 
-    * copy binary in /usr/bin/acdsn+    aptitude update && aptitude install ntpdate && ntpdate ntp.metas.ch</code> 
 +  - update the installation<code bash> 
 +    aptitude update && aptitude safe-upgrade</code> 
 +  - Install packages<code bash> 
 +    aptitude update && aptitude install automake make libtool flex byacc bison g++ libldap2-dev texinfo</code> 
 +  - Compile and install [[http://www.hyperrealm.com/libconfig/|libconfig]]<code bash> 
 +    ./configure && make && make install</code> 
 +    * If you get libtool: Version mismatch error.<code bash> 
 +      This is libtool 2.2.6, but the 
 +      libtool: definition of this LT_INIT comes from libtool 2.2.6b. 
 +      libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 
 +      libtool: and run autoconf again.</code> 
 +    *do:<code bash> 
 +      autoreconf --force --install</code> 
 +  - Reload libraries<code bash> 
 +    ldconfig</code> 
 +    *or<code bash> 
 +    /usr/bin/ldconfig -l /usr/local/lib/libconfig.so.9</code> 
 +  - Configure compile and install acdsn 
 +    * Modify Makefile.am with options: (-DACCESS or -DCONTROL or -DDRIVE)<code bash> 
 +    autoreconf -fvi 
 +    ./configure && make</code> 
 +    * copy binary in /usr/bin/acdsn (make install not yet implemented)
     * copy init file in /etc/init.d/acdsn and run update-rc.d acdsn     * copy init file in /etc/init.d/acdsn and run update-rc.d acdsn
   - configure files in /etc/acdsn (especially /dev/ttyS?)   - configure files in /etc/acdsn (especially /dev/ttyS?)
-  - keep the server on time (aptitude install ntpdate and then execute ntpdate ntp.metas.ch) +  - modify the [[acdsn:tmpfs#etc_default_tmpfs|/etc/default/tmpfs]] file to mount heavy files/directories into memory 
-  - modify the /etc/default/tmpfs file to mount heavy files/directories into memory +  - add the [[acdsn:tmpfs#etc_initd_tmpfs|tmpfs init script into /etc/init.d]]((http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot))((http://giantdorks.org/alain/managing-services-in-debian/))((http://www.debuntu.org/how-to-manage-services-with-update-rc.d)) and<code bash> 
-  - add the tmpfs init script into /etc/init.d and update-rc.d tmpfs defaults 10+    chmod +x tmpfs 
 +    update-rc.d tmpfs defaults 10 
 +    //OR 
 +    insserv tmpfs 
 +    </code> 
 +  - modify the [[acdsn:networks|/etc/network/interfaces]] to allow hotplug 
 + 
 +If you want to make an automatic reverse ssh tunnel, you can add: 
 +  - install expect package to create a remote ssh tunnel<code bash> 
 +    aptitude install expect</code> 
 +  - create a certificat<code bash> 
 +    ssh-keygen -t rsa</code> 
 +  - export the public key on the remote host<code bash> 
 +    cat id-rsa.pub >> authorized_keys</code> 
 +  - configure root bashrc<code bash> 
 +    export EDITOR=vi</code> 
 +  - add reverse ssh tunnel connection in crontab<code bash> 
 +    */5 * * * * /bin/bash /media/data/connect.sh -u sbolay -t bolay.co -e /media/data/.add-rsa -l 1091 -r 9031 
 +    */5 * * * * /bin/bash /media/data/connect.sh -u sbolay -t bolay.co -e /media/data/.add-rsa -l 22 -r 9023</code> 
 +===== Fine Tunning ===== 
 +==== apt-xapian-index ==== 
 +=> It is to hard for the kernel 
 +<code bash>aptitude purge apt-xapian-index</code>
  
-  - install expect package to create a remote ssh tunnel (aptitude install expect) +==== Less is More ==== 
-  - create a certificat (ssh-keygen -t rsa) +http://linux.koolsolutions.com/2009/05/07/how-small-can-you-make-your-linux-system-part-1/
-  - export the public key on the remote host (cat id-rsa.pub >> authorized_keys) +
-  - configure root bashrc (export EDITOR=vi) +
-  - add reverse ssh tunnel connection in crontab +
-*/5 * * * * /bin/bash /media/data/connect.sh -u sbolay -t bolay.co -e /media/data/.add-rsa -l 1091 -r 9031 +
-*/5 * * * * /bin/bash /media/data/connect.sh -u sbolay -t bolay.co -/media/data/.add-rsa -l 22 -r 9023+
  
 +==== monit ====
 +__From man page:__\\
 +//[[http://www.google.com/url?sa=t&rct=j&q=debian%20package%20monit&source=web&cd=1&ved=0CB8QFjAA&url=http%3A%2F%2Fpackages.debian.org%2Fmonit&ei=c-xKUJK3GeXR4QTbmoGQCQ&usg=AFQjCNGCng4CbOK-uWPXgJf-wQKs4lhtcw|monit]] is a utility for managing and monitoring processes, files, directories and filesystems on a Unix system.\\
 +Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.//
 +<code bash>aptitude install monit</code>
  
-If libconfig is missing, please configure (./configure) it, compile (make) it from the libconfig (1.4b4) folder then check (make check) it and then install it (sudo make install). Finally you may have to call ldconfig alone or /usr/bin/ldconfig -l /usr/local/lib/libconfig.so.9+Add configuration in /etc/monit/conf.d/acdsn 
 +<code bash> 
 +check process acdsn with pidfile /var/run/acdsn.pid 
 +start program = "/etc/init.d/acdsn start" with timeout 60 seconds 
 +stop program  = "/etc/init.d/acdsn stop" 
 +</code>
  
 +=== Reference ===
 +  * [[http://www.cyberciti.biz/tips/howto-monitor-and-restart-linux-unix-service.html|Monitor and restart Apache or lighttpd webserver when daemon is killed]]
 +  * You my be interested also to the respawn option of the [[http://unixhelp.ed.ac.uk/CGI/man-cgi?inittab+5|inittab]]. (See this [[http://www.linuxquestions.org/questions/linux-general-1/automatic-restart-3541/|post]])
acdsn/daemon_installation.1345568639.txt.gz · Last modified: 2012/08/21 17:03 by sbolay