[OpenSIPS-Users] Opensips 1.8.1 -problem

Shimon Mishal shimon.mishal at telrad.com
Thu Aug 30 17:30:58 CEST 2012


Hi list,

I've just install the 1.8.1 version.
But I get the following:
Could you please advise?

1.      [ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ opensipsctl start

INFO: Starting OpenSIPS :

ERROR: PID file /var/run/opensips.pid does not exist -- OpenSIPS start failed
[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ sudo tail /var/log/messages
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 193, column 18-19: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 202, column 21-22: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 223, column 20-21: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 229, column 19-20: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 233, column 18-19: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 240, column 19-20: unknown command <append_hf>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 247, column 18-19: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 253, column 18-19: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: CRITICAL:core:yyerror: parse error in config file, line 296, column 18-19: unknown command <is_method>, missing loadmodule?
Aug 30 14:49:48 ip-10-128-35-32 opensips: ERROR:core:main: bad config file (14 errors)
[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$
----------------------------------------------------------------------------------------------
2.      [ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ sudo opensipsdbctl create
ERROR: database engine not specified, please setup one in the config script

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ cat /etc/default/opensips
#
# OpenSIPS startup options
#

# Set to yes to enable opensips, once configured properly.
RUN_OPENSIPS=yes

# User to run as
USER=opensips

# Group to run as
GROUP=opensips

# Amount of memory to allocate for the running OpenSIPS server (in Mb)
MEMORY=128

# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable OpenSIPS to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
# a directory for the core files to get a dump. Look into the opensips
# init file for an example configuration.
DUMP_CORE=no
[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$

---------------------------------------------------------------------------------------------------------------------------------------------------

4.[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ cat /etc/init.d/opensips
#! /bin/sh
#
### BEGIN INIT INFO
# Provides:          opensips
# Required-Start:    $syslog $network $local_fs $time
# Required-Stop:     $syslog $network $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the OpenSIPS SIP server
# Description:       Start the OpenSIPS SIP server
### END INIT INFO
#
# TODO:
# The following fields should be added (and completed):
# Should-Start:      postgresql mysql radius
# Should-Stop:       postgresql mysql radius

PATH=/sbin:/bin:/usr/sbin:/usr/bin
#DAEMON=/usr/sbin/opensips
DAEMON=/usr/local/sbin/opensips
NAME=opensips
DESC=opensips
HOMEDIR=/var/run/opensips
PIDFILE=$HOMEDIR/$NAME.pid
DEFAULTS=/etc/default/opensips
RUN_OPENSIPS=no

# Do not start opensips if fork=no is set in the config file
# otherwise the boot process will just stop
check_fork ()
{
    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" /etc/opensips/opensips.cfg; then
        echo "Not starting $DESC: fork=no specified in config file; run /etc/init.d/opensips debug instead"
        exit 1
    fi
}

check_opensips_config ()
{
        # Check if opensips configuration is valid before starting the server
        set +e
        out=$($DAEMON -c 2>&1 > /dev/null)
        retcode=$?
        set -e
        if [ "$retcode" != '0' ]; then
            echo "Not starting $DESC: invalid configuration file!"
            echo -e "\n$out\n"
            exit 1
        fi
}

create_radius_seqfile ()
{
    # Create a radius sequence file to be used by the radius client if
    # radius accounting is enabled. This is needed to avoid any issue
    # with the file not being writable if opensips first starts as user
    # root because DUMP_CORE is enabled and creates this file as user
    # root and then later it switches back to user opensips and cannot
    # write to the file. If the file exists before opensips starts, it
    # won't change it's ownership and will be writable for both root
    # and opensips, no matter what options are chosen at install time
    RADIUS_SEQ_FILE=/var/run/opensips/opensips_radius.seq
    if [ -d /var/run/opensips ]; then
        chown ${USER}:${GROUP} /var/run/opensips

        if [ ! -f $RADIUS_SEQ_FILE ]; then
            touch $RADIUS_SEQ_FILE
        fi

        chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
        chmod 660 $RADIUS_SEQ_FILE
    fi
}

test -f $DAEMON || exit 0

# Load startup options if available
if [ -f $DEFAULTS ]; then
   . $DEFAULTS || true
fi

if [ "$RUN_OPENSIPS" != "yes" ]; then
    echo "OpenSIPS not yet configured. Edit /etc/default/opensips first."
    exit 0
fi

set -e

MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
[ -z "$USER" ]  && USER=opensips
[ -z "$GROUP" ] && GROUP=opensips
[ $MEMORY -le 0 ] && MEMORY=32

if test "$DUMP_CORE" = "yes" ; then
    # set proper ulimit
    ulimit -c unlimited

    # directory for the core dump files
    # COREDIR=/home/corefiles
    # [ -d $COREDIR ] || mkdir $COREDIR
    # chmod 777 $COREDIR
    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi

OPTIONS="-P $PIDFILE -m $MEMORY -u $USER -g $GROUP"

case "$1" in
  start|debug)
        check_opensips_config
        create_radius_seqfile

        if [ "$1" != "debug" ]; then
            check_fork
        fi

        echo -n "Starting $DESC: $NAME"
        start-stop-daemon --start --quiet --pidfile $PIDFILE \
                --exec $DAEMON -- $OPTIONS || echo -n " already running"
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
                --exec $DAEMON
        echo "."
        ;;
  restart|force-reload)
        check_opensips_config
        create_radius_seqfile

        echo -n "Restarting $DESC: $NAME"
        start-stop-daemon --oknodo --stop --quiet --pidfile \
                $PIDFILE --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                $PIDFILE --exec $DAEMON  -- $OPTIONS
        echo "."
        ;;
  status)
        echo -n "Status of $DESC: "
        if [ ! -r "$PIDFILE" ]; then
                echo "$NAME is not running."
                exit 3
        fi
        if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
                echo "$NAME is running."
                exit 0
        else
                echo "$NAME is not running but $PIDFILE exists."
                exit 1
        fi
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload|debug|status}" >&2
        exit 1
        ;;
esac

exit 0
[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

5.[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$ sudo cat /usr/local/etc/opensips/opensipsctlrc
# $Id: opensipsctlrc 9049 2012-05-24 14:03:31Z 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=opensips.org

## 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 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 acc domain group permissions registrar usrloc
#                   msilo alias_db uri_db speeddial avpops auth_db pdt dialog
#                   dispatcher dialplan drouting nathelper load_balancer"

# opensips extra modules
# EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist b2b registrant"


## 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

## do not display the output highlighted
# NOHLPRINT=1

## OPENSIPS START Options
## PID file path - default is: /var/run/opensips.pid
# PID_FILE=/var/run/opensips.pid
PID_FILE=/var/run/opensips/opensips.pid

## Extra start options - default is: not set
# example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=
#
SIP_DOMAIN=localhost
DBENGINE=MYSQL
DBHOST=localhost
DBNAME=opensips
DBRWUSER=opensips
DBRWPW="opensipsrw"
DBROUSER=opensipsro
DBROPW=opensipsro
DBROOTUSER="root"
USERCOL="username"
INSTALL_EXTRA_TABLES=ask
INSTALL_PRESENCE_TABLES=ask
INSTALL_SERWEB_TABLES=ask
CTLENGINE="FIFO"
OSIPS_FIFO="/tmp/opensips_fifo"
PID_FILE=/var/run/opensips/opensips.pid
[ec2-user at ip-10-128-35-32 opensips-1.8.1-tls]$


Regards

Shimon Mishal


 
 
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************






More information about the Users mailing list