[IRCServices] out of buffer?

Sean Kelly smkelly at zombie.org
Mon Jan 24 20:14:19 PST 2005


On Tue, Jan 25, 2005 at 08:43:53AM +0900, Andrew Church wrote:
> >Is there anyway to make ircservices save the databases when they recieve
> >~ like the HUP signal or something so I could save the current info to
> >XML using a shellscript?
> >
> >For ex:
> >killall -HUP ircservices && ./ircservices -export > foo.xml
> 
>      That's an interesting thought; the problem, of course, is that saving
> the databases isn't an instantaneous activity, so you'd need a sleep of
> some length in the middle.  I'll think about it.

Can't you hold an exclusive lock (flock, lockf, etc) on the database while
writing them and then release it when done writing? That way, the
`ircservices -export` could try to obtain a shared lock (since it is
read-only) and it will spin while the DBs are still being written.

-- 
Sean Kelly         | PGP KeyID: D2E5E296
smkelly at zombie.org | http://www.zombie.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : ../attachments/20050124/f3f7176c/attachment.pgp