Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#859 - OpenVPN is beeing killed with "service openvpn stop" due to short timeout #5898

Closed
openwrt-bot opened this issue Jun 20, 2017 · 4 comments
Labels

Comments

@openwrt-bot
Copy link

openwrt-bot commented Jun 20, 2017

helgadeville:

TP-LINK TL-MR-3220 v.2.x with LEDE 17.01.2 onboard, installed OpenVPN.

Connection opens successfully, however, on stopping with "service openvpn stop", logread shows:

Tue Jun 20 08:36:35 2017 daemon.info procd: Instance openvpn::instance1 pid 4084 not stopped on SIGTERM, sending SIGKILL instead
Tue Jun 20 08:36:35 2017 daemon.notice netifd: Network device 'tun0' link is down
Tue Jun 20 08:36:35 2017 daemon.notice netifd: Interface 'vyprvpn' has link connectivity loss

This causes OpenVPN scripts to abort.

If stopping openvpn with "killall -TERM openvpn", then it gets enough time to end in a nice way and all scripts are OK.

@openwrt-bot
Copy link
Author

openwrt-bot commented Jun 20, 2017

jow-:

How long does your openvpn take to properly shutdown? Do you have any complex teardown scripts or similar?

@openwrt-bot
Copy link
Author

openwrt-bot commented Jun 20, 2017

helgadeville:

It takes around 5 seconds, there are no complex teardown scripts, just one sending echo 0 > brightness to led.
I have resolved this problem on my device using a patch for /etc/init.d/openvpn script (attached), which adds term_timeout parameter to service instance, but this is a part of the problem: another problem is, that /lib/functions/procd.sh ignores term_timeout parameter, so I filed another bug report (see link) and added a small patch for procd.sh script.
Those 2 patches make my installation work as expected with no further workarounds.

@openwrt-bot
Copy link
Author

openwrt-bot commented Jun 20, 2017

jow-:

Right, I already staged a fix for term_timeout handling, but I wonder what a giod default tineout for openvpn would be. I think about 30s, that should cover most usecases.

@openwrt-bot
Copy link
Author

openwrt-bot commented Jun 21, 2017

helgadeville:

I agree. I gave it 15 secs, but in case the internet connection is poor, the disconnect process may take longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant