#StackBounty: #docker #openvpn #docker-compose "Multiple –up scripts defined" when running OpenVPN inside a Docker container

Bounty: 100

I’m using binhex/arch-rtorrentvpn and the contents of my docker-compose.yml are as follows:

version: "2"
    image: binhex/arch-rtorrentvpn
    container_name: rtorrent
      - NET_ADMIN
      - VPN_ENABLED=yes
      - VPN_USER=<myusername>
      - VPN_PASS=<mypassword>
      - VPN_PROV=custom
      - VPN_OPTIONS=--script-security 2 --up /config/persists/tun_up.sh
      - VPN_CLIENT=openvpn
      - ENABLE_RPC2=yes
      - ENABLE_RPC2_AUTH=no
      - LAN_NETWORK=
      - NAME_SERVERS=,
      - DEBUG=true
      - PHP_TZ=Europe/London
      - UMASK=000
      - PUID=1000
      - PGID=1000
      - ./config:/config
      - ./downloads:/downloads
      - /etc/localtime:/etc/localtime:ro
      - 9080:9080
      - 9443:9443
      - 8118:8118
    restart: unless-stopped

The issue I have is that, according to the [debug] output, my OpenVPN command line is as follows:

[debug] OpenVPN command line:- /usr/bin/openvpn 
--reneg-sec 0 
--setenv VPN_PROV 'custom' 
--setenv VPN_CLIENT 'openvpn' 
--setenv DEBUG 'true' 
--setenv VPN_DEVICE_TYPE 'tun0' 
--setenv VPN_ENABLED 'yes' 
--setenv VPN_REMOTE_SERVER '' 
--setenv APPLICATION 'rtorrent' 
--script-security 2 
--writepid /root/openvpn.pid 
--remap-usr1 SIGHUP 
--log-append /dev/stdout 
--pull-filter ignore 'up' 
--pull-filter ignore 'down' 
--pull-filter ignore 'route-ipv6' 
--pull-filter ignore 'ifconfig-ipv6' 
--pull-filter ignore 'tun-ipv6' 
--pull-filter ignore 'dhcp-option DNS6' 
--pull-filter ignore 'persist-tun' 
--pull-filter ignore 'reneg-sec' 
--up /root/openvpnup.sh 
--auth-user-pass credentials.conf 
--script-security 2 
--up /config/persists/tun_up.sh 
--cd /config/openvpn 
--config '/config/openvpn/nl910.nordvpn.com.tcp443.ovpn' 
--remote 443 tcp-client 

This throws the error: Multiple --up scripts defined. The previously configured script is overridden and the container will not start

I have tried calling the script by the below two methods, both of which resulted in the same error.

  • Calling the /root/openvpnup.sh script via using the ; separator. e.g.: VPN_OPTIONS=--script-security 2 --up /config/persists/tun_up.sh;/root/openvpnup.sh
  • Calling the /root/openvpnup.sh script by adding /root/openvpnup.sh to the end of my tun_up.sh script.

How can I get this to work?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.