Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 519928 - net-misc/openconnect - /etc/init.d/openconnect is too verbose when VPN has not yet been established
Summary: net-misc/openconnect - /etc/init.d/openconnect is too verbose when VPN has no...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Schultz
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-14 16:43 UTC by Tanktalus
Modified: 2014-12-09 00:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
openconnect.init.in-r3 (openconnect.init.in-r3,3.22 KB, text/plain)
2014-08-15 14:08 UTC, Matthew Schultz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tanktalus 2014-08-14 16:43:24 UTC
Lines 111-116 of /etc/init.d/openconnect runs "ip addr show $VPN" in a tight loop.  However, when the VPN isn't up yet, I get a bunch of output saying 'Device "vpn0" does not exist.' until the VPN connection is made.

1. This shouldn't be in a tight loop.  There should be a sleep, maybe "/usr/bin/sleep 0.5" to keep the load down.

2. stderr needs to be redirected from ip's output.

while true; do
  /usr/bin/sleep 0.5
  if [ -n "$(ip addr show $VPN 2> /dev/null | grep inet)" ]; then
#....

(Sleeping first is probably useful because it's going to take at least that long to make the connection anyway.)

Reproducible: Always

Steps to Reproduce:
1. Set up openconnect
2. Run /etc/init.d/openconnect.vpn0 restart
Comment 1 Matthew Schultz 2014-08-15 14:08:51 UTC
Created attachment 382928 [details]
openconnect.init.in-r3

Sent ip device not exist messages to stderr and slowed down the loop for running post up so that it waits for the interface to come up before it runs the script.
Comment 2 Mike Gilbert gentoo-dev 2014-12-09 00:17:31 UTC
I can't test it since I run systemd, but looks fine to me.

Thanks!

+  09 Dec 2014; Mike Gilbert <floppym@gentoo.org> metadata.xml:
+  Add myself as a maintainer.

+*openconnect-7.01 (09 Dec 2014)
+
+  09 Dec 2014; Mike Gilbert <floppym@gentoo.org> +files/openconnect.init.in-r3,
+  +openconnect-7.01.ebuild:
+  Version bump. init script adjustments, bug 519928.