[Zebralist] zebrasrv PID file

Adam Dickmeiss adam at indexdata.dk
Wed Oct 24 12:04:41 CEST 2007

Merijn van den Kroonenberg wrote:
> Hello,
> I am new to Zebra and I have a question. When starting zebrasrv as daemon, a 
> PID is written in the lock/zebrasrv.pid file.
> eg. 6050
> But after that the real server is started:
> 10:29:31-24/10 [server] Starting server zebrasrv pid=6051
> As a result the PID in the zebrasrv.pid file is "obsolete" (process does not 
> exist anymore).
> Also I noticed, if the previous process id was 33333 and the new id is 2222 
> then the pid file wil show 22223 (looks like data is overwritten but not 
> cleared).
> I wanted to use this zebrasrv.pid to make a shutdown script. I guess this 
> has to be done in another way. Any suggestions/pointers?

You are right that in daemon mode, it's incorrect. The -D option is 
handled by YAZ and Zebra does not "know" forking is in effect. IMHO, the 
zebrasrv.pid should go away.. The YAZ GFS has an option, -p, which 
allows you to specify the lock file. i.e.
   zebrasrv -D -p good.pid

There is another reason why zebrasrv should not write a PID file.. 
Privileges are wrong.. We want the PID file to be written in the 
"privileged" mode and sometimes not in the current directory (or zebra's 
lock directory). The preferred location is /var/run on many systems.. So 
you'd say:
   zebrasrv -u nobody -p /var/run/zebrasrv.pid -l \
            /var/log/zebrasrv.log -D

/ Adam

> Additionally I wondered if this list is searchable, i found the browsable 
> archive at http://lists.indexdata.dk/pipermail/zebralist/, but (ironically 
> ;-) ) no search functionality.
> Greetings,
> Merijn van den Kroonenberg
> Web2All B.V.
> Telefoon: +31 475 775511
> Fax:        +31 475 338290
> Email:      merijn at web2all.nl
> Website:  http://www.web2all.nl
> _______________________________________________
> Zebralist mailing list
> Zebralist at lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/zebralist

More information about the Zebralist mailing list