#20587: procd starts multiple instances of the same openvpn custom_config on
boot
----------------------+------------------------
Reporter: wenzhuo | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone:
Component: packages | Version: Trunk
Keywords: |
----------------------+------------------------
openwrt version: 15.05
router hardware: TL-WR720Nv3
I applied the xor patch to openvpn and built the firmware from source,
both of which shouldn't matter with the problem.
On boot of the router, procd always starts multiple (up to 6~7) instances
of the custom openvpn client configuration.
/etc/config/openvpn:
{{{
config openvpn custom_config
# Set to 1 to enable this instance:
option enabled 1
# Include OpenVPN configuration
option config /etc/openvpn/tcp.conf
}}}
/etc/openvpn/tcp.conf:
{{{
daemon
client
dev tun0
proto tcp-client
scramble SECRET # param added by the patch
remote aa.bb.cc.dd xyz
keepalive 6 30
route 10.8.0.1 255.255.255.255
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert WR720N-3.crt
key WR720N-3.key
ns-cert-type server
tls-auth ta.key 1
comp-lzo
verb 5
script-security 2 system
cd /etc/openvpn
route-up route-up.sh
down route-down.sh
}}}
Only the first instance which successfully created the tun0 device is able
to complete the connection to the openvpn server. All other instances will
fail because of failing to initialize tun0, which is specified in the
openvpn config file.
{{{
root@OpenWrt:~# egrep "OpenVPN 2|TUNSETIFF" /tmp/messages
Thu Sep 24 07:29:32 2015 daemon.notice openvpn(custom_config)[856]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:04 2015 daemon.notice openvpn(custom_config)[1206]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:09 2015 daemon.notice openvpn(custom_config)[1208]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:14 2015 daemon.notice openvpn(custom_config)[1210]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:19 2015 daemon.notice openvpn(custom_config)[1242]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:20 2015 daemon.err openvpn(custom_config)[1207]: ERROR:
Cannot ioctl TUNSETIFF tun0: Device or resource busy (errno=16)
Thu Sep 24 07:31:25 2015 daemon.notice openvpn(custom_config)[1244]:
OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH]
[IPv6] built on Sep 23 2015
Thu Sep 24 07:31:26 2015 daemon.err openvpn(custom_config)[1209]: ERROR:
Cannot ioctl TUNSETIFF tun0: Device or resource busy (errno=16)
Thu Sep 24 07:31:31 2015 daemon.err openvpn(custom_config)[1211]: ERROR:
Cannot ioctl TUNSETIFF tun0: Device or resource busy (errno=16)
Thu Sep 24 07:31:36 2015 daemon.err openvpn(custom_config)[1243]: ERROR:
Cannot ioctl TUNSETIFF tun0: Device or resource busy (errno=16)
Thu Sep 24 07:31:59 2015 daemon.err openvpn(custom_config)[1245]: ERROR:
Cannot ioctl TUNSETIFF tun0: Device or resource busy (errno=16)
}}}
After boot, the problem is very hard to reproduce by manually restarting
the openvpn instance.
{{{
# killall openvpn
# /etc/init.d/openvpn start
}}}
--
Ticket URL: <https://dev.openwrt.org/ticket/20587>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets