X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmetaproxy_prog.cpp;h=c470b906b7e89bc8bdfd412781fae0fb044a79fb;hb=HEAD;hp=5d176aeb51755d3e9f9230b4fb0bdbd4c1af6689;hpb=9fcdfa67cc281509e0f11e1f2aba255718a80cbd;p=metaproxy-moved-to-github.git diff --git a/src/metaproxy_prog.cpp b/src/metaproxy_prog.cpp index 5d176ae..c470b90 100644 --- a/src/metaproxy_prog.cpp +++ b/src/metaproxy_prog.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include #include #include #include @@ -123,6 +124,7 @@ static int sc_main( const char *pidfile = 0; const char *uid = 0; + yaz_enable_panic_backtrace(argv[0]); set_log_prefix(); while ((ret = options("c{config}:Dh{help}l:m:p:tu:v:V{version}w:X", @@ -216,6 +218,11 @@ static int sc_main( , test_config ? "test" : "start" ); + char yaz_version_str[20]; + char yaz_sha1_str[41]; + yaz_version(yaz_version_str, yaz_sha1_str); + yaz_log(YLOG_LOG, "YAZ %s %s", yaz_version_str, yaz_sha1_str); + xmlInitParser(); LIBXML_TEST_VERSION @@ -258,9 +265,11 @@ static int sc_main( yaz_sc_running(s); - yaz_daemon("metaproxy", mode, mode == YAZ_DAEMON_DEBUG ? - work_debug : work_normal, router, pidfile, uid); + yaz_daemon("metaproxy", mode | YAZ_DAEMON_LOG_REOPEN, + (mode & YAZ_DAEMON_FORK) ? work_normal : work_debug, + router, pidfile, uid); } + delete router; } catch (std::logic_error &e) { yaz_log(YLOG_FATAL,"std::logic error: %s" , e.what() );