Module: kamailio
Branch: master
Commit: e3b8b76d7a8773af4e10ce011682931429cd4a87
URL:
https://github.com/kamailio/kamailio/commit/e3b8b76d7a8773af4e10ce011682931…
Author: Gustavo Almeida <gustavo.abcdef(a)hotmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-03-10T15:38:33+01:00
utils/kamctl: allow the definition of a specific startup file at start process
- Added the possibility to specify an alternative file different from the default:
kamailio.cfg, when starting kamailio, using the kamctl tool.
This makes it possible to start kamailio by passing a startup file located in a specific
folder (via ETCDIR env variable) and with a specific name, instead of using the default
name: kamailio.cfg.
---
Modified: utils/kamctl/kamctl
Modified: utils/kamctl/kamctlrc
---
Diff:
https://github.com/kamailio/kamailio/commit/e3b8b76d7a8773af4e10ce011682931…
Patch:
https://github.com/kamailio/kamailio/commit/e3b8b76d7a8773af4e10ce011682931…
---
diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index fbb237eb00..214cd21e5a 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -73,6 +73,10 @@ if [ -z "$MYLIBDIR" ] ; then
fi
fi
+if [ -z "$STARTUP_CONFIG_FILE" ]; then
+ STARTUP_CONFIG_FILE="kamailio.cfg"
+fi
+
##### ------------------------------------------------ #####
### load base functions
#
@@ -2007,9 +2011,9 @@ kamailio_start() {
exit 1
fi
if [ $SYSLOG = 1 ] ; then
- $KAMBIN -P $PID_FILE -f $ETCDIR/kamailio.cfg $STARTOPTIONS 1>/dev/null
2>/dev/null
+ $KAMBIN -P $PID_FILE -f $ETCDIR/$STARTUP_CONFIG_FILE $STARTOPTIONS 1>/dev/null
2>/dev/null
else
- $KAMBIN -P $PID_FILE -E -f $ETCDIR/kamailio.cfg $STARTOPTIONS
+ $KAMBIN -P $PID_FILE -E -f $ETCDIR/$STARTUP_CONFIG_FILE $STARTOPTIONS
fi
sleep 3
if [ ! -s $PID_FILE ] ; then
diff --git a/utils/kamctl/kamctlrc b/utils/kamctl/kamctlrc
index fe9cc1fc48..ce0bd9d93b 100644
--- a/utils/kamctl/kamctlrc
+++ b/utils/kamctl/kamctlrc
@@ -159,6 +159,10 @@
## PID file path - default is: /run/kamailio/kamailio.pid
# PID_FILE=/run/kamailio/kamailio.pid
+## Kamailio Startup Configuration File
+## Default is: kamailio.cfg
+# STARTUP_CONFIG_FILE=kamailio.cfg
+
## Extra start options - default is: not set
## example: start Kamailio with 64MB shared memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=