[SRU] Exit status 127 when starting openvpn when its already started.

Bug #271777 reported by wayne
26
Affects Status Importance Assigned to Milestone
openvpn (Ubuntu)
Fix Released
Low
Unassigned
Hardy
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: openvpn

Using package openvpn/hardy uptodate 2.1~rc7-1ubuntu3.3

Line 57 is not a valid variable assignment as below.

    # Check to see if it's already started...
    if test -e /var/run/openvpn.$NAME.pid ; then
57 STATUS = "FAILED - Already running (PID file exists)."
    else
      $DAEMON --writepid /var/run/openvpn.$NAME.pid \
              $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
              --config $CONFIG_DIR/$NAME.conf < /dev/null || STATUS="FAILED"
    fi
    log_action_msg "$NAME ($STATUS)"

Revision history for this message
Thierry Carrez (ttx) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - the Intrepid Ibex.

The easy workaround is to fix the line to remove the extra spaces around the = sign (STATUS="Failed...").

Changed in openvpn:
importance: Undecided → Low
status: New → Fix Released
Revision history for this message
wayne (wayne-flashmedia) wrote :

Yes, that is an easy fix which I have done on all my servers. I don't agree with marking this priority as low as it breaks heartbeat which is incredibly important to many non-redhat server implementations.

This release is supposed to be supported till April 2013 (Server) https://wiki.ubuntu.com/Releases. An important package like openvpn should be supported properly until end of life or lts is worth nothing. Please push this change into Hardy.

wayne (wayne-flashmedia)
Changed in openvpn:
status: Fix Released → Incomplete
Revision history for this message
Thierry Carrez (ttx) wrote :

You are interested in having this bug fixed in a SRU (stable release update) for hardy. I am closing it as "Fix released" because the bug has been fixed in the latest development version of Ubuntu - the Intrepid Ibex.

If you need a fix for the bug in previous versions of Ubuntu, please follow the SRU Procedure [1] to bring the need to a developer's attention.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates

In particular you should use "Nominate for release" to target it for a hardy update.

I set it to "Low" because I couldn't think of something that would break due to that wrong return code. Could you please explain your heartbeat scenario so that the bug priority is set up properly ?

Changed in openvpn:
status: Incomplete → Fix Released
Revision history for this message
Mathias Gug (mathiaz) wrote :

I am closing it because the bug has been fixed in the latest development version of Ubuntu - the Intrepid Ibex.
If you need a fix for the bug in previous versions of Ubuntu, please do steps 1 and 2 of the SRU Procedure [1] to bring the need to a developer's attention.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Revision history for this message
wayne (wayne-flashmedia) wrote :

Thanks for the info. I'll follow that up.

The heartbeat scenario goes as follows.
In a simple v1 config setup where server A has resources and server B dies.
Server A re-runs all the resources allocated to it.
When openvpn is re-run the exit code is non-zero and heartbeat thinks its resources have failed.
When this non-zero exit code is detected the Server A thinks its resources have failed and then passes them over to Server B.
Since server B is dead all the resources are now turned off and I'm up at 2am fixing it.
You can then understand why I feel so strongly about this seemingly minor issue.

Revision history for this message
Thierry Carrez (ttx) wrote :

Proposed debdiff for hardy

Revision history for this message
Thierry Carrez (ttx) wrote :

Hardy SRU Report

Bug impact: When openvpn is already started, trying to start it using the init script results in exit status 127. This can impact heartbeat deployments as mentionned in comment 5.

Versions affected: Hardy (openvpn initscript was rewritten in Intrepid)

Minimal patch: see comment 6 just above.

TEST CASE:
$ sudo apt-get install openvpn
Unpack the attached vpnconf.tar.gz into /etc/openvpn
$ sudo /etc/init.d/openvpn restart (should start the "server" VPN)
$ sudo /etc/init.d/openvpn start
Without the fix, fails with "/etc/init.d/openvpn: 181: STATUS: not found" and exit status 127
With the fix, warns with "server (FAILED - Already running (PID file exists).)" and exits with status 0

Regression potential:
Given the simplicity of the patch, regression potential is null. Nobody should have been relying on exit code 127 which was the result of a failed bash variable assignment.

Changed in openvpn:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

Note that openvpn_2.1~rc7-1ubuntu3.4 is still sitting in -proposed, so I'll work on confirming the fix for it (on bug 265058) as well.

Revision history for this message
Thierry Carrez (ttx) wrote :

I just can't reproduce bug 265058 so I would drop the 3.4 changes before uploading this, unless the reporter there helps us... but we have been asking for a long time and I feel bad delaying this SRU for that reason.

Revision history for this message
Martin Pitt (pitti) wrote :

OK, if you think that bug 265058 isn't worth pursuing, please revert the change, set it to WONTFIX, and upload your's. Thanks!

Revision history for this message
Thierry Carrez (ttx) wrote :

Debdiff reverting 2.1~rc7-1ubuntu3.4 and applying fix.

openvpn (2.1~rc7-1ubuntu3.5) hardy-proposed; urgency=low

  * Revert changes from 2.1~rc7-1ubuntu3.4 since verification could never be
    done on that bug and it is blocking another much-needed SRU.
  * debian/openvpn.init.d: Fix initscript exit status 127 when starting
    openvpn while it's already started (LP: #271777)

Revision history for this message
Thierry Carrez (ttx) wrote :

Debdiff from 2.1~rc7-1ubuntu3.3 to 2.1~rc7-1ubuntu3.5 to review proper reversion and compare with minimal patch mentioned in SRU report.

Thierry Carrez (ttx)
Changed in openvpn (Ubuntu Hardy):
status: Confirmed → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted openvpn into hardy-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Thierry Carrez (ttx)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvpn - 2.1~rc7-1ubuntu3.5

---------------
openvpn (2.1~rc7-1ubuntu3.5) hardy-proposed; urgency=low

  * Revert changes from 2.1~rc7-1ubuntu3.4 since verification could never be
    done on that bug and it is blocking another much-needed SRU.
  * debian/openvpn.init.d: Fix initscript exit status 127 when starting
    openvpn while it's already started (LP: #271777)

 -- Thierry Carrez <email address hidden> Wed, 06 May 2009 14:45:27 +0000

Changed in openvpn (Ubuntu Hardy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.