Browse code

core: added global parameter run_dir

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

Daniel-Constantin Mierla authored on 21/04/2015 19:20:10
Showing 4 changed files
... ...
@@ -417,6 +417,7 @@ USER		"user"|"uid"
417 417
 GROUP		"group"|"gid"
418 418
 CHROOT		"chroot"
419 419
 WDIR		"workdir"|"wdir"
420
+RUNDIR		"rundir"|"run_dir"
420 421
 MHOMED		mhomed
421 422
 DISABLE_TCP		"disable_tcp"
422 423
 TCP_CHILDREN	"tcp_children"
... ...
@@ -821,6 +822,7 @@ IMPORTFILE      "import_file"
821 821
 <INITIAL>{GROUP}	{ count(); yylval.strval=yytext; return GROUP; }
822 822
 <INITIAL>{CHROOT}	{ count(); yylval.strval=yytext; return CHROOT; }
823 823
 <INITIAL>{WDIR}	{ count(); yylval.strval=yytext; return WDIR; }
824
+<INITIAL>{RUNDIR}	{ count(); yylval.strval=yytext; return RUNDIR; }
824 825
 <INITIAL>{MHOMED}	{ count(); yylval.strval=yytext; return MHOMED; }
825 826
 <INITIAL>{DISABLE_TCP}	{ count(); yylval.strval=yytext; return DISABLE_TCP; }
826 827
 <INITIAL>{TCP_CHILDREN}	{ count(); yylval.strval=yytext; return TCP_CHILDREN; }
... ...
@@ -468,6 +468,7 @@ extern char *default_routename;
468 468
 %token GROUP
469 469
 %token CHROOT
470 470
 %token WDIR
471
+%token RUNDIR
471 472
 %token MHOMED
472 473
 %token DISABLE_TCP
473 474
 %token TCP_ACCEPT_ALIASES
... ...
@@ -999,6 +1000,9 @@ assign_stm:
999 999
 	| WDIR EQUAL STRING     { working_dir=$3; }
1000 1000
 	| WDIR EQUAL ID         { working_dir=$3; }
1001 1001
 	| WDIR EQUAL error      { yyerror("string value expected"); }
1002
+	| RUNDIR EQUAL STRING     { runtime_dir=$3; }
1003
+	| RUNDIR EQUAL ID         { runtime_dir=$3; }
1004
+	| RUNDIR EQUAL error      { yyerror("string value expected"); }
1002 1005
 	| MHOMED EQUAL NUMBER { mhomed=$3; }
1003 1006
 	| MHOMED EQUAL error { yyerror("boolean value expected"); }
1004 1007
 	| DISABLE_TCP EQUAL NUMBER {
... ...
@@ -128,6 +128,7 @@ extern int sock_gid;
128 128
 extern int sock_mode;
129 129
 extern char* chroot_dir;
130 130
 extern char* working_dir;
131
+extern char* runtime_dir;
131 132
 extern int sr_auto_aliases;
132 133
 extern int sr_msg_time;
133 134
 extern str version_table;
... ...
@@ -353,6 +353,7 @@ int received_dns = 0;
353 353
 int sr_auto_aliases=1;
354 354
 char* working_dir = 0;
355 355
 char* chroot_dir = 0;
356
+char* runtime_dir = "" RUN_DIR;
356 357
 char* user=0;
357 358
 char* group=0;
358 359
 int uid = 0;