Skip to content

Instantly share code, notes, and snippets.

@fpauser
Last active April 28, 2023 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fpauser/b12fb11fe2d7333583c92086f7226bf7 to your computer and use it in GitHub Desktop.
Save fpauser/b12fb11fe2d7333583c92086f7226bf7 to your computer and use it in GitHub Desktop.
Fix glib2 issues preventing openvpn3-client from working

Related: OpenVPN/openvpn3-linux#171

Prerequisites

sudo dnf install wget

Install fix

openvpn3-glib3-fedora38-fix.sh install

Uninstall

openvpn3-glib3-fedora38-fix.sh uninstall

Reinstall openvpn3-client

openvpn3-glib3-fedora38-fix.sh reinstall_openvpn3_client

#!/bin/env bash
install () {
if [ -f "/usr/libexec/openvpn3-linux/openvpn3-run-wrapper" ]; then echo "Already installed, exiting."; exit; fi
rm -rf /tmp/openvpn3-workaround
mkdir /tmp/openvpn3-workaround
cd /tmp/openvpn3-workaround || exit
wget https://kojipkgs.fedoraproject.org//packages/glib2/2.74.6/1.fc37/x86_64/glib2-2.74.6-1.fc37.x86_64.rpm -O glib2.rpm
rpm2cpio glib2.rpm | cpio -idm
sudo mkdir -p /usr/libexec/openvpn3-linux/glib2
sudo cp usr/lib64/libg* /usr/libexec/openvpn3-linux/glib2/
cd /usr/libexec/openvpn3-linux || exit
sudo bash -c 'cat > openvpn3-run-wrapper' <<'EOF'
#!/bin/bash
LD_PRELOAD="/usr/libexec/openvpn3-linux/glib2/libglib-2.0.so.0.7400.6 /usr/libexec/openvpn3-linux/glib2/libgobject-2.0.so.0.7400.6 /usr/libexec/openvpn3-linux/glib2/libgio-2.0.so.0.7400.6" ${0}.bin $*
EOF
sudo chmod +x ./openvpn3-run-wrapper
sudo bash -c 'for f in openvpn3-service*; do if [ -f $f ]; then echo "$f -> $f.bin"; mv $f $f.bin; ln -s openvpn3-run-wrapper $f; fi; done'
}
uninstall() {
cd /usr/libexec/openvpn3-linux || exit
sudo rm -rf /usr/libexec/openvpn3-linux/glib2
sudo rm -f /usr/libexec/openvpn3-linux/openvpn3-run-wrapper
sudo bash -c 'for f in openvpn3-service*; do if [ -L $f ]; then echo "$f.bin -> $f"; mv $f.bin $f; fi; done'
sudo rm openvpn3-service-*.bin
}
reinstall_openvpn3_client() {
sudo dnf remove openvpn3-client
sudo dnf install openvpn3-client
}
case "$1" in
install)
install
;;
uninstall)
uninstall
;;
reinstall_openvpn3_client)
reinstall_openvpn3_client
;;
*)
echo "Usage: $0 {install|uninstall|reinstall_openvpn3_client}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment