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