Starting and Stopping

From Cipango

Jump to: navigation, search

There are three ways to start/stop Cipango:

Command line

The most straightforward way to start Cipango is to open a shell at the root of your Cipango installation and to enter:

java -jar start.jar

By default, the configuration file etc/cipango.xml is used. Alternatively, you may specify a specific configuration file as follows:

java -jar start.jar path/to/myconf.xml

To stop, simply use Ctrl-C in the same terminal. You may also start Cipango so that it listens on a local port for stop commands:

java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar etc/cipango.xml

The server can then be stopped using a different terminal window on the same machine:

java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar --stop

If you omit the stop port or key, they are displayed on the standard output so that you may know their values.

Unix daemon

To start Cipango under Unix-like systems, go to CIPANGO_HOME/bin and type:

./cipango.sh start

This script may be invoked with the following commands stop, run, restart, check and supervise

shell commands

cipango.sh looks-up for the following files:

  • /etc/default/cipango
  • $HOME/.cipangorc

If they exist, these files are read at the execution of the script. They may contain any sequence of shell commands, like setting relevant environment variables.


# Where Cipango is installed
CIPANGO_HOME=/home/user/cipango

JAVA_HOME=/usr/local/jdk1.6.0

# Set max heap sise to 512MB and initial size to 256MB 
JAVA_OPTIONS=="-Xmx512M -Xms256M -XX:+UseParNewGC -XX:+UseConcMarkSweepGC"

# Override the default SIP host
SIP_HOST=192.168.1.2

Override the default SIP port
SIP_PORT=5060

Override the default HTTP port
JETTY_PORT=8080

# File containing Cipango configuration files
CIPANGO_CONF=/home/user/etc/cipango.conf

Environnement properties

CIPANGO_HOME refers to the directory where Cipango is installed. If this property is not set, the script tries go guess it by first looking at the invocation path of the script, and then by looking in standard locations as

  • $HOME/opt/cipango
  • /opt/cipango
  • /usr/local/cipango
  • ...

The java system property cipango.home will be set to this value for use by configure.xml files, for instance:

<Arg><SystemProperty name="cipango.home" default="."/>/sipapps</Arg>
Property Description
JAVA_HOME Home of your Java installation
JAVA Command to invoke Java. If not set, $JAVA_HOME/bin/java will be used.
JAVA_OPTIONS Extra options to pass to the JVM
CIPANGO_CONSOLE Where Cipango console output should go. Defaults to first writeable of
  • /dev/console
  • /dev/tty
SIP_PORT Override the default SIP port for Cipango servers. If not set then the default value in the xml configuration file will be used. The java system property "sip.port" will be set to this value for use in configure.xml files. For example, the following idiom is widely used in the demo config files to respect this property in Listener configuration elements:
<Set name="Port"><SystemProperty name="sip.port" default="5060"/></Set>

Note: that the config file could ignore this property simply by saying:

<Set name="Port">5060</Set>
SIP_HOST Override the default SIP host for Cipango servers. If not set then the default value in the xml configuration file will be used. The java system property "sip.host" will be set to this value for use in Cipango.xml file.
JETTY_PORT Override the default HTTP port for Cipango servers. If not set then the default value in the xml configuration file will be used. The java system property "jetty.port" will be set to this value for use in configure.xml files.
CIPANGO_RUN Where the Cipango.pid file should be stored. It defaults to the first available of /var/run, /usr/var/run, and /tmp if not set.
CIPANGO_PID The Cipango PID file, defaults to $CIPANGO_RUN/cipango.pid
CIPANGO_ARGS The default arguments to pass to Cipango.


cipango.conf

cipango.sh searches for cipango.conf in

  1. /etc/cipango.conf
  2. $CIPANGO_HOME/etc/cipango.conf

This file will be used as this script's configuration. Each line in the file may contain:

  • A comment denoted by the pound (#) sign as first non-blank character.
  • The path to a regular file, which will be passed to Cipango as a config.xml file.
  • The path to a directory. Each \*.xml file in the directory will be passed to Cipango as a config.xml file.

Note: If more than one argument is passed to the script (cipango.sh start etc/cipango.xml), cipango.conf is not read

Note 2: Absolute path must be used if Cipango is not started from $CIPANGO_HOME/bin

Personal tools