Run modes

There's several run mode that you can use :

  • synchronous mode : this is the simplest way to start LSC. Once the source service has been listed, objects are retrieved from the source and from the destination. New objects are created, existing are updated and at the end the LSC will stop (no more daemon or program running)
  • clean mode : this mode is complementary to the first one for cleaning the destination service by retrieving objects and checking their existence inside the source service. If they exist nothing is done but if they don't they are deleted from the destination service.
  • asynchronous mode : in this mode, LSC is started as a daemon. If the source service has something to synchronize, LSC will retrieve updated objects one by one and will synchronize it wich the destination service. If no update is provided, LSC will sleep for 5 seconds and try again. It will never stop until an explicit request is done.

Starting LSC

LSC can be start with either synchronous or asynchronous mode. In synchronous mode, LSC can also schedule a clean mode at the end of the synchronous mode.

Synchronous launch

lsc -s <comma separated list of tasks' name|"all" keyword>

Clean launch

lsc -c <comma separated list of tasks' name|"all" keyword>

Clean mode can be combined with synchronous mode but not with asynchronous mode.

Asynchronous launch

lsc -a <comma separated list of tasks' name|"all" keyword>

When multiple asynchronous tasks are started, they are started as separate thread inside the same daemon.

Using start/stop service script

A service script is provided in LSC, installed by default with RPM. This script allows to launch LSC in asynchronous mode:

/etc/init.d/lsc start

You can test configuration:

/etc/init.d/lsc configtest

And get the process status:

/etc/init.d/lsc status

This service script can be configured in /etc/default/lsc:

#====================================================================
# Configuration for LSC init script
# (http://www.lsc-project.org).
#====================================================================

# LSC installation
LSC_BIN="/usr/local/lsc/bin/lsc"
LSC_CFG_DIR="/usr/local/lsc/etc"
LSC_USER=""
LSC_GROUP=""
LSC_PID_FILE="/var/run/lsc.pid"
LSC_TASKS="all"

# JMX
LSC_JMXPORT="1099"

# JAVA
#JAVA_HOME=/usr/java/jdk/jre

This allows you to run several connectors. You just have to duplicate the service to run it:

ln -s /etc/init.d/lsc /etc/init.d/lsc2
cp /etc/default/lsc /etc/default/lsc2

Interaction with an already started instance

When LSC is started in asynchronous mode, it is still possible to request operations through the JMX protocol.

LSC daemon required options for JMX remote invocation

You will have to launch the LSC instance with at least one asynchronous task and the JMX port specified:

$ export LSC_JMXPORT=1099
$ lsc -a <comma separated list of tasks' name|"all" keyword>

But doing such settings, please notice that anyone can send commands to your LSC instance listening on all your network interfaces on the 1099 TCP port ! (At this time this is not a simple task to bind JMX to the local interface only, RFU :)

LSC remote invocation by lsc-agent command line tool

The lsc-agent command line tool is able to connect remotely to the LSC instance and to do some interesting things :

  • -a gives the ability to start a named task
  • -l provides a list of asynchronous tasks
  • -s gives the status (running or not) of an named task

When starting a task, if the id and pivot attributes are provided (-i and -t options), LSC will start the corresponding synchronous task. If not, LSC will start the corresponding asynchronous task.

Of course it is possible to specify an hostname and a port to connect to another host through -h and -p parameters.