Menu

#572 opensipsdbctl create fails

1.5.x
closed-wont-fix
nobody
tools (25)
2
2015-04-07
2012-10-24
Perazim
No

Running 1.5.3 on openwrt. Sorry this is such an old version but 1.5.3 is the newest available for openwrt. Configured for mysql and mysql is initialized itself and running. I have configured opensips.cfg and opensipsctlrc properly. When I run opensipsdbctl create, I receive:

root@OpenWrt:/etc/opensips# opensipsdbctl create
/usr/sbin/opensipsdbctl: /usr/lib/opensips//opensipsctl/opensipsdbctl.base: line 35: syntax error: missing '}'

I have looked at the code and don't see anything missing.

Next, I built opensips on a Fedora 14 system. This yields the same results as above.

What's wrong here?

Perazim

Discussion

  • Bogdan-Andrei Iancu

    Hi Perazim,

    1.5.3 is no longer maintained (see http://www.opensips.org/Main/Ver15x ) - I suggest to download sources from 1.8 for usage.

    BTW, what shell are you using ?

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • status: open --> open-wont-fix
     
  • Bogdan-Andrei Iancu

    • priority: 5 --> 2
     
  • Perazim

    Perazim - 2012-10-26

    This is on an openwrt (trunk) system:

    root@OpenWrt:~# sh

    BusyBox v1.19.4 (2012-10-15 14:49:33 IST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    root@OpenWrt:~#

    Perazim

     
  • Bogdan-Andrei Iancu

    Try to run opensipsdnctl via the "bash" shell to see if you still get the error.

    Bogdan

     
  • Perazim

    Perazim - 2012-10-26

    Same error returned when using bash. I built openwrt with bash included as I have extra flash memory and ran:

    # bash
    # ?
    bash: ?: command not found (to verify it is really bash running)

    root@OpenWrt:/etc# opensipsdbctl create
    /usr/sbin/opensipsdbctl: /usr/lib/opensips//opensipsctl/opensipsdbctl.base: line 35: syntax error: missing '}'
    root@OpenWrt:/etc#

    Then I looked in /usr/sbin/opensipsdbctl and updated #!/bin/sh to #!bin/bash and got further in the process:

    root@OpenWrt:/usr/lib/opensips/opensipsctl# opensipsdbctl create
    /usr/lib/opensips//opensipsctl/opensipsdbctl.mysql: line 50: stty: command not found
    MySQL password for root: /usr/lib/opensips//opensipsctl/opensipsdbctl.mysql: line 52: stty: command not found
    n7p0sq12
    /usr/lib/opensips//opensipsctl/opensipsdbctl.mysql: line 54: stty: command not found

    INFO: test server charset
    mysql: can't load library 'libncursesw.so.5'
    mysql: can't load library 'libncursesw.so.5'
    BusyBox v1.19.4 (2012-10-26 12:55:11 IST) multi-call binary.

    Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

    Search for PATTERN in FILEs (or stdin)

    -H Add 'filename:' prefix
    -h Do not add 'filename:' prefix
    -n Add 'line_no:' prefix
    -l Show only names of files that match
    -L Show only names of files that don't match
    -c Show only count of matching lines
    -o Show only the matching part of line
    -q Quiet. Return 0 if PATTERN is found, 1 otherwise
    -v Select non-matching lines
    -s Suppress open and read errors
    -r Recurse
    -i Ignore case
    -w Match whole words only
    -F PATTERN is a literal (not regexp)
    -E PATTERN is an extended regexp
    -m N Match up to N times per file
    -A N Print N lines of trailing context
    -B N Print N lines of leading context
    -C N Same as '-A N -B N'
    -e PTRN Pattern to match
    -f FILE Read pattern from file

    /usr/lib/opensips//opensipsctl/opensipsdbctl.mysql: line 114: [: =: unary operator expected
    INFO: creating database opensips ...
    mysql: can't load library 'libncursesw.so.5'
    ERROR: Creating core database and grant privileges failed!
    root@OpenWrt:/usr/lib/opensips/opensipsctl#

    Which I haven't yet had a chance to follow up on. Looks like opensipsdbctl is shell type sensative. From looking at this forum, it seems that you work this on fridays. After today, would the next time you look at this be in a week?

    Thanks for the help.

    Perazim

     
  • Perazim

    Perazim - 2012-10-26

    So besides not running when using the busybox ash shell, I also had to include stty when I included the bash shell. Then I had to deal with libncursesw not being included for some reason, appears to be a bug in the openwrt build system. I added it via opkg package and this fixed the mysql problem. Now back to why opensipsdbctl create doesn't work: The path to the shared sql scripts was way wrong and once corrected, these sql scripts were not even included in the openwrt port of opensips.

    I don't understand how all of this could have even come close to running. Maybe it was only used with some other database?

    Once I correct this, I will get back to you with what I did.

    Thanks,
    Perazim

     
  • Ovidiu Sas

    Ovidiu Sas - 2012-10-26

    Try to use optware: http://www.nslu2-linux.org/
    The package there should be properly built.

    Regards,
    Ovidiu Sas

     
  • Bogdan-Andrei Iancu

    • status: open-wont-fix --> closed-wont-fix
     

Log in to post a comment.