From: Adam Dickmeiss Date: Thu, 15 Sep 2011 09:12:15 +0000 (+0200) Subject: Facility to change working directory for daemon X-Git-Tag: v1.6.2~2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=3e59f10fe3e32e6e632b46a1118e8a06c2b722a9;p=pazpar2-moved-to-github.git Facility to change working directory for daemon Option -wdir sets working directory to dir. --- diff --git a/doc/pazpar2.xml b/doc/pazpar2.xml index 9e346e8..4cbe5f8 100644 --- a/doc/pazpar2.xml +++ b/doc/pazpar2.xml @@ -38,8 +38,9 @@ - + + @@ -167,6 +168,15 @@ + + + + Sets log level (YAZ log level system). + + + + + @@ -178,10 +188,10 @@ - + - Sets log level (YAZ log level system). + Changes working directory to dir. diff --git a/src/pazpar2.c b/src/pazpar2.c index fcbbca2..f51fa9e 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -152,6 +152,14 @@ static int sc_main( break; case 'V': show_version(); + break; + case 'w': + if (chdir(arg)) + { + yaz_log(YLOG_FATAL|YLOG_ERRNO, "chdir %s", arg); + return 1; + } + break; case 'X': global_parameters.debug_mode++; global_parameters.predictable_sessions = 1; @@ -169,6 +177,7 @@ static int sc_main( " -u uid Change user to uid\n" " -V Show version\n" " -v level Set log level\n" + " -w dir Working directory\n" " -X Debug mode\n" #ifdef WIN32 " -install Install windows service\n"