linux returns EAGAIN for closed ocserv interfaces

Nikos Mavrogiannopoulos nmav at
Sat Sep 27 02:46:39 PDT 2014

On Fri, 2014-09-26 at 20:57 +0200, Nikos Mavrogiannopoulos wrote:

> > > That doesn't matter much for ocserv as there are no multiple threads. It
> > > was added as it looked reasonable for other OSes which may not behave as
> > > Linux.
> > 
> > I'm not convinced there are any. I know of no other userspace which will
> > retry a close() call. And it's hard to imagine how it could ever be
> > necessary. The *flush* might fail, but closing the file descriptor is
> > always easy enough because it just involves throwing away local state.
> > 
> > Also, we close all file descriptors when a process exits. If close() can
> > fail, that makes a horrid mess of the task exit code path. I dread to
> > think how this could ever be handled. I just don't think it can happen.
> Niels, could you try this patch then (against master). If close() indeed
> fails you should see "close failed:" in syslog. Otherwise we should
> figure the real reason behind that issue.

An additional way to obtain more information is lsof -p PID. Where PID
is the PID of the main ocserv process (should be listed as ocserv-main
in ps -e), as well as to the worker process that corresponds to the
connection that caused the issue (the PID is the same as the ID in occtl


More information about the openconnect-devel mailing list