Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
aports
aports
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 652
    • Issues 652
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 182
    • Merge Requests 182
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • alpine
  • aportsaports
  • Issues
  • #5027

Closed
Open
Opened Jan 17, 2016 by Chris Kankiewicz@PHLAK
  • Report abuse
  • New issue
Report abuse New issue

OpenVPN client down script fails to restore original resolv.conf

The default installation of OpenVPN includes an up.sh and down.sh script in the /etc/openvpn directory. When using these scripts (i.e. openvpn —script-security 2 —up /etc/openvpn/up.sh —down /etc/openvpn/down.sh) the up script successfully backs up the original resolv.conf script to resolv.conf-tun0.sv but upon stopping the OpenVPN client the down script fails to restore the default resolv.conf. I’ve tracked the issue down to line 18 of /etc/openvpn/down.sh:

cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf

When running this command with verbose output you get the following error message:

cp: can't create '/etc/resolv.conf': File exists

(from redmine: issue id 5027, created on 2016-01-17, closed on 2016-03-18)

  • Changesets:
    • Revision 34c1dfa8 by Chris Kankiewicz on 2016-01-26T22:11:23Z:
main/openvpn: fix down script not restoring original resolv.conf

This patch fixes an error where, in the provided OpenVPN down script, the
cp command would fail due to the resolv.conf file already existing.

Instead of using cp we cat the file contents over the exising resolv.conf
file to avoid the error and preserve any symlinks that may exist.

fixes #5027

(cherry picked from commit bfdc08d49cfd221709ce29ad6f81a651461c71e2)
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
3.3.2
Milestone
3.3.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
3
Labels
Aports Normal type:bug
Assign labels
  • View project labels
Reference: alpine/aports#5027