[OpenSIPS-Users] Some strange things with starting opensips
Chris Liu
cachris68 at yahoo.ca
Fri Jan 14 05:26:40 CET 2011
Hi everyone,
We can use opensipsctl start and service opensips start to startupopensips, can
anybody show me the different of these two ways?
On my CentOS system, when I use service opensips start tostartup the system, no
opensips.pid in /var/run and I can find /tmp/opensips_fifo but it will disapear
in about 10 mins. If I use opensipsctl start to start the system,
/tmp/opensips_fifo and opensips.pid are fine.
But interest thing is seems service opensips start doesn't use the configure
file. I changed the name of configure file and try service opensips start, It
works with no error! Anybody know which configure file be use by it?
[root at OpenSIP1/etc/opensips]# mvopensips.cfgopensips.cfg_
[root at OpenSIP1/etc/opensips]# opensipsctl stop
INFO: Stopping OpenSIPS :
INFO: stopped
[root at OpenSIP1/etc/opensips]# opensipsctl start
INFO: Starting OpenSIPS :
INFO: started (pid: 15088)
======================================================================
[root at OpenSIP1/etc/opensips]# cat opensipsctlrc
# $Id: opensipsctlrc 7337 2010-10-28 22:02:46Z osas $
#
# The OpenSIPS configuration file for the control tools.
#
# Here you can set variables used in the opensipsctl and opensipsdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.
## your SIP domain
SIP_DOMAIN=192.168.8.170
## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"
## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT,
## by default none is loaded
# If you want to setup a database with opensipsdbctl, you must at least specify
# this parameter.
DBENGINE=MYSQL
## database host
DBHOST=localhost
## database name (for ORACLE this is TNS name)
DBNAME=opensips
# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/opensips/dbtext"
## database read/write user
DBRWUSER=opensips
## password for database read/write user
DBRWPW="opensipsrw"
## database read only user
DBROUSER=opensipsro
## password for database read only user
DBROPW=opensipsro
## database super user (for ORACLE this is 'scheme-creator' user)
# DBROOTUSER="root"
# user name column
# USERCOL="username"
# SQL definitions
# If you change this definitions here, then you must change them
# in db/schema/entities.xml too.
# FIXME
# FOREVER="2020-05-28 21:32:15"
# DEFAULT_ALIASES_EXPIRES=$FOREVER
# DEFAULT_Q="1.0"
# DEFAULT_CALLID="Default-Call-ID"
# DEFAULT_CSEQ="13"
# DEFAULT_LOCATION_EXPIRES=$FOREVER
# Program to calculate a message-digest fingerprint
# MD5="md5sum"
# awk tool
# AWK="awk"
# grep tool
# GREP="grep"
# sed tool
# SED="sed"
# Describe what additional tables to install. Valid values for the variables
# below are yes/no/ask. With ask (default) it will interactively ask the user
# for an answer, while yes/no allow for automated, unassisted installs.
#
# If to install tables for the modules in the EXTRA_MODULES variable.
# INSTALL_EXTRA_TABLES=ask
# If to install presence related tables.
# INSTALL_PRESENCE_TABLES=ask
# Define what module tables should be installed.
# If you use the postgres database and want to change the installed tables,
# then you must also adjust the STANDARD_TABLES or EXTRA_TABLES variable
# accordingly in the opensipsdbctl.base script.
# opensips standard modules
# STANDARD_MODULES="standard acclcr domain group permissions registrar usrloc
# msilo alias_db uri_db speeddialavpopsauth_db pdtdialog
# dispatcher dialplandroutingnathelper load_balancer"
# opensips extra modules
# EXTRA_MODULES="imc cpl siptracedomainpolicycarrierrouteuserblacklist b2b"
## type of aliases used: DB - database aliases; UL - usrloc aliases
## - default: none
ALIASES_TYPE="DB"
## control engine: FIFO or UNIXSOCK
## - default FIFO
# CTLENGINE=xmlrpc
## path to FIFO file
OSIPS_FIFO="/tmp/opensips_fifo"
## MI_CONNECTOR control engine: FIFO, UNIXSOCK, UDP, XMLRPC
# MI_CONNECTOR=FIFO:/tmp/opensips_fifo
# MI_CONNECTOR=UNIXSOCK:/tmp/opensips.sock
# MI_CONNECTOR=UDP:192.168.2.133:8000
# MI_CONNECTOR=XMLRPC:192.168.2.133:8000
## check ACL names; default on (1); off (0)
# VERIFY_ACL=1
## ACL names - if VERIFY_ACL is set, only the ACL names from below list
## are accepted
# ACL_GROUPS="local ld int voicemail free-pstn"
## verbose - debug purposes - default '0'
# VERBOSE=1
## do (1) or don't (0) store plaintext passwords
## in the subscriber table - default '1'
# STORE_PLAINTEXT_PW=0
## OPENSIPS START Options
## PID file path - default is: /var/run/opensips.pid
PID_FILE=/var/run/opensips.pid
## Extra start options - default is: not set
# example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=
=============================================================================
#>cat /etc/init.d/opensips
#!/bin/bash
#
# Startup script for OpenSIPS
#
# chkconfig: 2345 20 80
# description: OpenSIPS is a fast SIP Server.
#
# processname: opensips
# pidfile: /var/run/opensips.pid
# config: /etc/opensips/opensips.cfg
#
### BEGIN INIT INFO
# Provides: opensips
# Required-Start: $local_fs $network $named
# Should-Start: mysqldpostgresql
# Short-Description: start, stop OpenSIPS
# Description: OpenSIPS is a very fast and flexible SIP (RFC3261) server.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
oser=/sbin/opensips
prog=opensips
RETVAL=0
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
echo -n $"Starting $prog: "
# there is something at end of this output which is needed to
# report proper [ OK ] status in Fedora scripts
daemon $oser $OPTIONS 2>/dev/null
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
}
stop() {
echo -n $"Stopping $prog: "
killproc $oser
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $oser
RETVAL=$?
;;
restart|reload)
stop
start
;;
condrestart)
if [ -f /var/run/opensips.pid ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog
{start|stop|reload|restart|condrestart|status|help}"
exit 1
esac
exit $RETVAL
Thanks
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110113/0ff0444d/attachment-0001.htm>
More information about the Users
mailing list