Re: [Dovecot] stopping dovecot
On Jul 26, 2008, at 8:29 PM, Timo Sirainen wrote: On Jul 26, 2008, at 10:05 PM, Arkadiusz Miskiewicz wrote: I think the imap-login processes will hang around if there are SSL or proxy connections through them (but perhaps they shouldn't be listen-ing for new connections?). It would be good if existing clients were not disconnected but starting dovecot would be possible. That's how daemons for other services behave. This is how it should work, but for some reason netstat still shows the process as listening even after closing the listener file descriptors. I'll try to figure out later what the problem is. Perhaps some stupid mistake that I'm not noticing now, or perhaps it has something to do with the fd being opened by the master process and transferred to a forked child process.. Fixed: http://hg.dovecot.org/dovecot-1.1/rev/0e880665fcba PGP.sig Description: This is a digitally signed message part
Re: [Dovecot] stopping dovecot
On Sun, 27 Jul 2008, Kai Schaetzl wrote: It does kill everything. Not for me, not with the 1.07 I have in CentOS 5.2. When I ran service dovecot restart (or stop) in that situation it did *not* kill all the pop3-login children. I had to use killall. It is normal for some services to terminate te main process, but leave active children alive. Especially for pop3 processes, as they can be considered to terminate soon due to protocol design. Same goes for ssh for example. You can kill (stop, or restart) the main sshd, without killing the sessions currently running. Exim also does similar things. Killing all children could result in data corruption, since seen flags etc. need to be saved before exiting. The restarting after 2 seconds thing I just saw in another mail can possibly be prevented by using the appropriate setsockopts on the listen port (SO_REUSEADDR in this case, if I'm not mistaken). This may however very well be a Linux-specific solution. Regards, Maarten Bezemer
Re: [Dovecot] stopping dovecot
Maarten Bezemer wrote on Sun, 27 Jul 2008 11:43:06 +0200 (CEST): It is normal for some services to terminate te main process, but leave active children alive. That may be so, but Timo claimed the opposite (as I read his response). I'm merely pointing out that I cannot see the behavior that Timo states. If you want to get rid of all these processes you have to killall. Especially for pop3 processes, as they can be considered to terminate soon due to protocol design. Can you elaborate on this? Also, have a look at the thread I mentioned. Dozens pop3-login processes were staying sleeping for 5 or more hours. There was no remote part anymore. Doesn't sound like they terminated soon due to protocol design. Same goes for ssh for example. You can kill (stop, or restart) the main sshd, without killing the sessions currently running. Yes. Right you are. And especially with ssh it's quite helpful ;-) The restarting after 2 seconds thing I just saw in another mail can possibly be prevented by using the appropriate setsockopts on the listen port (SO_REUSEADDR in this case, if I'm not mistaken). This may however very well be a Linux-specific solution. That concerns the tidying up? In my case it wasn't a problem with still occupied ports, I checked for presence of processes. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
Re: [Dovecot] stopping dovecot
On Sun, 2008-07-27 at 13:31 +0200, Kai Schaetzl wrote: Maarten Bezemer wrote on Sun, 27 Jul 2008 11:43:06 +0200 (CEST): It is normal for some services to terminate te main process, but leave active children alive. That may be so, but Timo claimed the opposite (as I read his response). I'm merely pointing out that I cannot see the behavior that Timo states. If you want to get rid of all these processes you have to killall. The behavior is controlled by shutdown_clients setting. I suppose you have it set to no? signature.asc Description: This is a digitally signed message part
Re: [Dovecot] stopping dovecot
Timo Sirainen wrote on Sun, 27 Jul 2008 17:14:29 +0300: The behavior is controlled by shutdown_clients setting. I suppose you have it set to no? It's set to how dovecot.conf came: #shutdown_clients = yes If that indicates the default it is enabled. But it didn't work. The thread I started wasn't so much about killing these children with a shutdown, anyway. It was about the behavior that these login processes stayed there for more than five hours after a dictionary attack that took only a few minutes before they eventually died away slowly. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
[Dovecot] stopping dovecot
This may be a silly question but how to correctly stop dovecot and be sure that it's possible to start it again? kill -TERM `cat /var/run/dovecot/master.pid` doesn't work well. I have imap-login processes staying arround and occupying port which leads to Fatal: listen(0.0.0.0, 993) failed: Address already in use when trying to start again 2s after stopping. -- Arkadiusz MiśkiewiczPLD/Linux Team arekm / maven.plhttp://ftp.pld-linux.org/