Module: kamailio
Branch: master
Commit: ca1358f21efab04146eaf438daac160cd901f19d
URL: 
https://github.com/kamailio/kamailio/commit/ca1358f21efab04146eaf438daac160cd901f19d

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2015-04-21T21:20:10+02:00

core: added global parameter run_dir

- to be used to build the path for runtime files (fifo, ctl)

---

Modified: cfg.lex
Modified: cfg.y
Modified: globals.h
Modified: main.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/ca1358f21efab04146eaf438daac160cd901f19d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ca1358f21efab04146eaf438daac160cd901f19d.patch

---

diff --git a/cfg.lex b/cfg.lex
index de18d62..95edfdb 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -417,6 +417,7 @@ USER                "user"|"uid"
 GROUP          "group"|"gid"
 CHROOT         "chroot"
 WDIR           "workdir"|"wdir"
+RUNDIR         "rundir"|"run_dir"
 MHOMED         mhomed
 DISABLE_TCP            "disable_tcp"
 TCP_CHILDREN   "tcp_children"
@@ -821,6 +822,7 @@ IMPORTFILE      "import_file"
 <INITIAL>{GROUP}       { count(); yylval.strval=yytext; return GROUP; }
 <INITIAL>{CHROOT}      { count(); yylval.strval=yytext; return CHROOT; }
 <INITIAL>{WDIR}        { count(); yylval.strval=yytext; return WDIR; }
+<INITIAL>{RUNDIR}      { count(); yylval.strval=yytext; return RUNDIR; }
 <INITIAL>{MHOMED}      { count(); yylval.strval=yytext; return MHOMED; }
 <INITIAL>{DISABLE_TCP} { count(); yylval.strval=yytext; return DISABLE_TCP; }
 <INITIAL>{TCP_CHILDREN}        { count(); yylval.strval=yytext; return 
TCP_CHILDREN; }
diff --git a/cfg.y b/cfg.y
index c302d5e..85e69a6 100644
--- a/cfg.y
+++ b/cfg.y
@@ -468,6 +468,7 @@ extern char *default_routename;
 %token GROUP
 %token CHROOT
 %token WDIR
+%token RUNDIR
 %token MHOMED
 %token DISABLE_TCP
 %token TCP_ACCEPT_ALIASES
@@ -999,6 +1000,9 @@ assign_stm:
        | WDIR EQUAL STRING     { working_dir=$3; }
        | WDIR EQUAL ID         { working_dir=$3; }
        | WDIR EQUAL error      { yyerror("string value expected"); }
+       | RUNDIR EQUAL STRING     { runtime_dir=$3; }
+       | RUNDIR EQUAL ID         { runtime_dir=$3; }
+       | RUNDIR EQUAL error      { yyerror("string value expected"); }
        | MHOMED EQUAL NUMBER { mhomed=$3; }
        | MHOMED EQUAL error { yyerror("boolean value expected"); }
        | DISABLE_TCP EQUAL NUMBER {
diff --git a/globals.h b/globals.h
index 03937a2..60ffd25 100644
--- a/globals.h
+++ b/globals.h
@@ -128,6 +128,7 @@ extern int sock_gid;
 extern int sock_mode;
 extern char* chroot_dir;
 extern char* working_dir;
+extern char* runtime_dir;
 extern int sr_auto_aliases;
 extern int sr_msg_time;
 extern str version_table;
diff --git a/main.c b/main.c
index 8451e97..1ff7f6a 100644
--- a/main.c
+++ b/main.c
@@ -353,6 +353,7 @@ int received_dns = 0;
 int sr_auto_aliases=1;
 char* working_dir = 0;
 char* chroot_dir = 0;
+char* runtime_dir = "" RUN_DIR;
 char* user=0;
 char* group=0;
 int uid = 0;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to