[Kolab-devel] kolab daemon, not really daemon !

Alain Spineux aspineux at gmail.com
Fri Aug 10 19:04:17 CEST 2007


Hello

I don't know if this will break the BIG BANG theory, but ....

You know a UNIX child process inherits some info from  its parent :
open file (socket too:-) , session, terminal, some signal setup,
current working dir,  ....
But normally daemon process should close all the opened files and take care of
all these stuff

When I run kolabconf from my web interface I find some kolab's daemons
inheriting these 'things' from my web application :-)

Here is the test case, I use a script that open file /tmp/kolab.bug
before to start kolabconf.

I stop kolabd

# openpkg rc kolabd stop

I disable any cyrus related service in web admin : POP, IMAP, SIEVE ...,
to force imapd to restart, then I run kolabconf

# kolabconf

Then I run this script

-----------------------snip ----------------
#!/bin/bash

touch /tmp/kolab.bug
exec 45<> /tmp/kolab.bug

openpkg rc kolabd stop

echo Chnage configuration in web admin ENTER
read

kolabconf
sleep 5

echo Now look for open files in kolabs daemons then press ENTER
ps -p `fuser /tmp/kolab.bug 2> /dev/null `
read

exec 45>&-
-----------------------snip ----------------

At the first prompt  I restore the imap services in web admin , then
press ENTER

An get the following output :

[root at fc6-eg trunk]# sh  kolab_bug.sh
OpenPKG: stop: kolabd.
Chnage configuration in web admin ENTER

kolabconf - Kolab Configuration Generator

  Version: 2.0.99

  Copyright (c) 2004  Klaraelvdalens Datakonsult AB
  Copyright (c) 2003  Code Fusion cc
  Copyright (c) 2003  Tassilo Erlewein, Martin Konold, Achim Frank, erfrakon

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
OpenPKG: restart: imapd.
OpenPKG: stop: proftpd.
Now look for open files in kolabs daemons then press ENTER
  PID TTY      STAT   TIME COMMAND
 3425 pts/1    S+     0:00 sh kolab_bug.sh
 3944 pts/1    S+     0:00 /kolab/bin/cyrmaster
 3993 pts/1    S+     0:00 notifyd
32161 ?        Ssl    0:00 /kolab/libexec/openldap/slapd -h ldap:// ldaps://
32165 ?        Ssl    0:00 /kolab/libexec/openldap/slurpd

Finally I press CTRL-C

Here is the list of all process with "/tmp/kolab.bug" open !!!
This means some daemon keep parents files opened !!!
Imaging you start kolabconf from a web application, the
web socket stay opened by these kolab daemon and you
cannot restart your web application without restarting kolab !

AND THE BEST OF THE BEST, when I kill my web application,
I get some of these kolab's daemons killed too (imap a least,
if you pressed CTRL-C, look if imap is still there) !!!

All test made on fedora core 6 running kolab 2.1 beta 3

I will test soon in centos 5 with kolab 2.2 beta 1

Comment are welcome !!!

Does it means openldap and cyrus developers are ...... !
I hope I missed something !

Regards

-- 
--
Alain Spineux
aspineux gmail com
May the sources be with you




More information about the devel mailing list