Hi developers Firstly, let me have a introduction of my case A TCP-based accelerator (serverspeeder or lotserver) provided by Appex was deployed on my vps, and it was embedded into the kernel supposedly. On the average it worked very well with eth0, but question is it isn't very supportive with ocserv, because it cannot detect the dynamical launch or destroy of the tun device perfectly. Then I add a script (some limited function supported by serverspeeder) to force it detect a new interface. On connect phase everything is ok, as I can see, the script followed the "assigning tun device xxx". The key issue comes to the disconnect phase that serverspeeder seems detect the release of a tun device, once the client sends the disconnect message, and then serverspeeder crashes(that seemed like a deadlock of detecting the the released tun's communication). All of these happened before my disconnect script execute a re-detect of all interfaces. I think the problem could lie on the sequence of the execution. vpn-setup complete -> connect-script -> normal communication -> .... -> client disconnect -> waiting for the disconnect-script -> the release of the worker and vpn -> user disconnect The sequence above is what I think is reasonable, while now what I glanced over the log is the disconnect script cannot work as soon as the client message was received. My log is here: Aug 4 11:36:55 ocserv[5584]: TLS[<5>]: REC[0x7554b0]: SSL 3.3 Application Data packet received. Epoch 0, length: 77 Aug 4 11:36:55 ocserv[5584]: TLS[<5>]: REC[0x7554b0]: Expected Packet Application Data(23) Aug 4 11:36:55 ocserv[5584]: TLS[<5>]: REC[0x7554b0]: Received Packet Application Data(23) with length: 77 Aug 4 11:36:55 ocserv[5584]: TLS[<5>]: REC[0x7554b0]: Decrypted Packet[71] Application Data(23) with length: 61 Aug 4 11:36:55 ocserv[5584]: worker[phone]: 110.*.*.* received 61 byte(s) (TLS) Aug 4 11:36:55 ocserv[5584]: worker[phone]: 110.*.*.* received BYE packet; exiting Aug 4 11:36:55 ocserv[5573]: sec-mod: received request from pid 5584 and uid 65534 Aug 4 11:36:55 ocserv[5584]: worker[phone]: 110.*.*.* sending message 'sm: cli stats' to secmod Aug 4 11:36:55 ocserv[5573]: sec-mod: cmd [size=54] sm: cli stats Aug 4 11:36:55 ocserv[5584]: worker[phone]: 110.*.*.* sent periodic stats (in: 11319, out: 3301) to sec-mod Aug 4 11:36:55 kernel: [ 4256.084050] appex: is down Aug 4 11:36:55 kernel: [ 4256.091651] appex: is down Aug 4 11:36:55 kernel: [ 4256.096116] appex: is del Aug 4 11:36:55 ocserv[5572]: main[phone]: 110.*.*.*:58886 command socket closed Aug 4 11:36:55 ocserv[5572]: main[phone]: 110.*.*.*:58886 user disconnected Aug 4 11:36:55 ocserv[5572]: main[phone]: 110.*.*.*:58886 sending msg sm: session close to sec-mod Aug 4 11:36:55 ocserv[5573]: sec-mod: received request sm: session close Aug 4 11:36:55 ocserv[5573]: sec-mod: cmd [size=24] sm: session close Aug 4 11:36:55 ocserv[5573]: sec-mod: invalidating session of user 'phone' (session: SIyp0) Aug 4 11:36:55 ocserv[5573]: sec-mod: permamently closing session of user 'phone' (session: SIyp0) Aug 4 11:36:55 ocserv[5601]: main[phone]: 110.*.*.*:58886 executing script down /home/ocserv/tests/connect-script Could anybody give me a hand to solve this problem, or some hints? please Thanks for all your reading and looking forward to your reply.