From: chantra In-Reply-To: References: Content-Type: multipart/alternative; boundary="=-nt2g5dwyInb9xO7LBSgB" Date: Thu, 24 Jun 2010 13:58:29 +0200 Message-ID: <1277380709.2567.73.camel@...1259...> Mime-Version: 1.0 Subject: Re: [Openvpn-devel] ovpn daemon not seeing my plugin thread... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vineet Kumar Cc: openvpn-devel@lists.sourceforge.net --=-nt2g5dwyInb9xO7LBSgB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit > The reason is obviously the fact that the thread-creation occurred > *before* the daemon() call (that forked off a child which has no way > of inheriting a copy of that thread). > So does this mean then that the ovpn daemon infrastructure will only > work with plugins that don't do threading of their own? You might want to look at openvpn_plugin_select_initialization_point_v1 function as done here http://redmine.debuntu.org/projects/openvpn-ldap-auth/repository/revisions/master/entry/src/ldap-auth.c#L430 -- http://www.debuntu.org !DSPAM:4c23486761671948424632! --=-nt2g5dwyInb9xO7LBSgB Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
The reason is obviously the fact that the thread-creation occurred
*before* the daemon() call (that forked off a child which has no way
of inheriting a copy of that thread).
So does this mean then that the ovpn daemon infrastructure will only
work with plugins that don't do threading of their own?
You might want to look at
openvpn_plugin_select_initialization_point_v1  function

as done here
http://redmine.debuntu.org/projects/openvpn-ldap-auth/repository/revisions/master/entry/src/ldap-auth.c#L430

-- 
http://www.debuntu.org
!DSPAM:4c23486761671948424632! --=-nt2g5dwyInb9xO7LBSgB--