X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzserver.c;h=b4d6b898eb5ddd413219739f7c4d45bc61ca0a7e;hb=72fb813b56c42335985ef47d9d2a23ebc456eae0;hp=24aad32b8ec4ab0825218436da9e5647ed13629f;hpb=58e3c5132f9fe86fefbf2e130275ab9980eeed1e;p=idzebra-moved-to-github.git diff --git a/index/zserver.c b/index/zserver.c index 24aad32..b4d6b89 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,5 +1,5 @@ -/* $Id: zserver.c,v 1.108 2003-06-18 11:46:33 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: zserver.c,v 1.111 2003-09-05 12:35:06 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps This file is part of the Zebra server. @@ -382,6 +382,7 @@ static int es_admin_request (ZebraHandle zh, Z_AdminEsRequest *r) break; case Z_ESAdminOriginPartToKeep_drop: yaz_log(LOG_LOG, "adm-drop"); + zebra_drop_database (zh, r->toKeep->databaseName); break; case Z_ESAdminOriginPartToKeep_create: yaz_log(LOG_LOG, "adm-create %s", r->toKeep->databaseName); @@ -656,20 +657,24 @@ static void bend_start (struct statserv_options_block *sob) #else if (!sob->inetd) { + char pidfname[4096]; struct flock area; - char *pidfile = "zebrasrv.pid"; - int fd = open (pidfile, O_EXCL|O_WRONLY|O_CREAT, 0666); + int fd; + + zebra_pidfname(sob->handle, pidfname); + + fd = open (pidfname, O_EXCL|O_WRONLY|O_CREAT, 0666); if (fd == -1) { if (errno != EEXIST) { - yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfile); + yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname); exit(1); } - fd = open(pidfile, O_RDWR, 0666); + fd = open(pidfname, O_RDWR, 0666); if (fd == -1) { - yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfile); + yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname); exit(1); } } @@ -697,8 +702,12 @@ static void bend_stop(struct statserv_options_block *sob) #ifdef WIN32 #else - if (!sob->inetd) - unlink ("zebrasrv.pid"); + if (!sob->inetd && sob->handle) + { + char pidfname[4096]; + zebra_pidfname(sob->handle, pidfname); + unlink (pidfname); + } #endif if (sob->handle) {