3

When I run opensipsctl start command for start opensips that time I got one error.

ERROR: PID file /var/run/opensips.pid does not exist -- OpenSIPS start failed

So please help me to solve it.

Laur Ivan
  • 4,117
  • 3
  • 38
  • 62
Deep Patel
  • 101
  • 1
  • 2
  • 10

3 Answers3

2

open up opensipsctl, it includes the file opensipsctlrc, which defined $PID_FILE as /var/run/opensips.pid

Then in opensipsctl, when you run start one of the checks is..

    if [ ! -s $PID_FILE ] ; then
            echo
            merr "PID file $PID_FILE does not exist -- OpenSIPS start failed"
            exit 1
    fi

Which is saying if then check of whethever '/var/run/opensips.pid exists and is bigger than 0 bytes' fails, then echo out the above error.

This means the file isn't being created.

If you look just above that line it does..

    if [ $SYSLOG = 1 ] ; then
            $OSIPSBIN -P $PID_FILE $STARTOPTIONS 1>/dev/null 2>/dev/null
    else
            $OSIPSBIN -P $PID_FILE -E $STARTOPTIONS
    fi

Which is where opensips actually starts. I would suggest adding the following to your opensips.cfg if you havn't already..

# Logging
debug=6
log_stderror=no               
log_facility=LOG_LOCAL0

..now everything will be logged to /var/log/syslog on boot.

Try boot again, then look at that log for info about what's happened.

Another thing to check, is the user you're running opensips as has permission to access the directory it's trying to create the pid file in.

BIGMOOSE
  • 146
  • 7
0

I had the same error & it was driving me mad as well. I managed to trace it down to one of two things - I had both!

1/ A misconfiguration in the OpenSIPS config file. journalctl -xe should be able to tell you what the error is

2/ Something else is listening on the port that you are trying to listen on

For 2, you can try the below, if you have Ubuntu, to see if anything is already listening on that port

lsof -i :5060

0

I was able to see logs and fix issue by below steps

Set log_level=4 in opensips.cfg to view debug logs in /var/log/syslog

debug is deprecated in 2.4 and higher version. You can refer here for different log level

Spoorthy
  • 17
  • 3