User Tools

Site Tools


doc:appunti:linux:sa:liquidfeedback

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:linux:sa:liquidfeedback [2012/11/11 13:20] – [Cronjob] niccolodoc:appunti:linux:sa:liquidfeedback [2012/11/11 13:27] – [Install a second instance of LiquidFeedback on the same host] niccolo
Line 176: Line 176:
 ===== lf_update daemon ===== ===== lf_update daemon =====
  
-The script **''lf_update''** must be run regulary:+The **''lf_update''** core program must be run regulary:
  
 <code> <code>
Line 183: Line 183:
 </code> </code>
  
-We must prepare a script that runs in an endless loop **''/usr/local/sbin/lf_updated''**:+We must prepare a script that runs in an endless loop**''/usr/local/sbin/lf_updated''**:
  
 <code bash> <code bash>
Line 206: Line 206:
 </code> </code>
  
-and a script that start/stop the daemon **''/etc/init.d/lf_updated''**:+The script contains database credentials, so protect it: 
 + 
 +<code> 
 +chown root:root /usr/local/sbin/lf_updated 
 +chmod 750 /usr/local/sbin/lf_updated 
 +</code> 
 + 
 +Then preare a script that start/stop the daemon**''/etc/init.d/lf_updated''**:
  
 <code bash> <code bash>
 +#! /bin/sh
 +### BEGIN INIT INFO
 +# Provides:          lf_updated
 +# Required-Start:    $syslog
 +# Required-Stop:     $syslog
 +# Default-Start:     2 3 4 5
 +# Default-Stop:      0 1 6
 +# Short-Description: lf_updated
 +# Description:       Calls LiquidFeedback lf_update regulary
 +### END INIT INFO
 +
 +# PATH should only include /usr/* if it runs after the mountnfs.sh script
 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
 +DESC="lf_updated"
 +NAME=lf_updated
 +DAEMON=/usr/local/sbin/lf_updated
 +DAEMON_ARGS=""
 +PIDFILE=/var/run/$NAME.pid
 +SCRIPTNAME=/etc/init.d/$NAME
 +
 +. /lib/lsb/init-functions
 +
 +do_start()
 +{
 +        start-stop-daemon -b --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
 +        start-stop-daemon -b --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
 +}
 +
 +do_stop()
 +{
 +        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
 +        RETVAL="$?"
 +        [ "$RETVAL" = 2 ] && return 2
 +        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
 +        [ "$?" = 2 ] && return 2
 +        rm -f $PIDFILE
 +        return "$RETVAL"
 +}
 +
 +case "$1" in
 +  start)
 +        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 +        do_start
 +        case "$?" in
 +                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 +                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 +        esac
 +        ;;
 +  stop)
 +        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
 +        do_stop
 +        case "$?" in
 +                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 +                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 +        esac
 +        ;;
 +  status)
 +       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
 +       ;;
 +  restart|force-reload)
 +        log_daemon_msg "Restarting $DESC" "$NAME"
 +        do_stop
 +        case "$?" in
 +          0|1)
 +                do_start
 +                case "$?" in
 +                        0) log_end_msg 0 ;;
 +                        1) log_end_msg 1 ;; # Old process is still running
 +                        *) log_end_msg 1 ;; # Failed to start
 +                esac
 +                ;;
 +          *)
 +                # Failed to stop
 +                log_end_msg 1
 +                ;;
 +        esac
 +        ;;
 +  *)
 +        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 +        exit 3
 +        ;;
 +esac
 +
 +:
 </code> </code>
 +
 +Activate the start/stop script at bootstrap:
 +
 +<code>
 +chmod 755 /etc/init.d/lf_updated
 +insserv lf_updated
 +</code>
 +
 +The daemon logs to syslog with the **''lf_updated''** tag.
 ===== Configuring Apache ===== ===== Configuring Apache =====
  
Line 313: Line 413:
 FIXME Verify if this checklist is complete. FIXME Verify if this checklist is complete.
  
-  - Create another database. +  - Create another **database**
-  - Create another Apache VirtualHost and declare the configuration filename in **''WEBMCP_CONFIG_NAME''**.+  - Create another **Apache VirtualHost** and declare the configuration filename in **''WEBMCP_CONFIG_NAME''**.
   - Create another config file in ''/usr/local/share/liquid_feedback_frontend/config/'' configuring at least **''absolute_base_url''** and **''database''** credentials.   - Create another config file in ''/usr/local/share/liquid_feedback_frontend/config/'' configuring at least **''absolute_base_url''** and **''database''** credentials.
 +  - Add or update the **''lf_updated''** daemon to run on each database instance.
 ===== LiquidFeedback administration ===== ===== LiquidFeedback administration =====
  
doc/appunti/linux/sa/liquidfeedback.txt · Last modified: 2012/11/11 13:58 by niccolo