Pre-Submission Checklist

Type Of Change

Checklist:

Description

kamctl now sources the kamctlrc from only one location if available in this order:

  1. same folder as kamctl,
  2. {intstall_prefix}/etc/kamailio/,
  3. ~/.kamctlrc
  4. /etc/kamailio/.

If no kamctlrc is found, it continues just like before. Should it stop?

Issue description

kamctl uses env variables from all the config files above, and retains the env value of the latest config that declares it.

Let's say we have 3 kamctlrc files right now:

# first config file (same folder that kamctl resides)
# {prefix_install}/sbin/kamctlrc
...
SIP_DOMAIN=kamailio.org
DBENGINE is commented
...
# second config file 
# /etc/kamailio/kamctlrc
...
SIP_DOMAIN=kam02.tst.nbg.gilawa.net
DBENGINE=MYSQL
...
# third config file 
# {prefix_install}/etc/kamailio/kamctlrc
...
SIP_DOMAIN is commented
DBENGINE=MYSQL
...

Running {install_prefix}/sbin/kamctl (before changes in order) it prints :

Loading config file /home/xenofon/kamailio-source-install/sbin/kamctlrc
Loading config file /etc/kamailio/kamctlrc
Loading config file /home/xenofon/kamailio-source-install/etc/kamailio//kamctlrc
SIP_DOMAIN env var is kam02.tst.nbg.gilawa.net
DBENGINE env var is MYSQL

suggesting that env variables from multiple sources are gathered and overwritten in cases.


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3594

Commit Summary

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3594@github.com>