OpenVPN: script failed: could not execute external program

15 Jun 2011 by David (admin)
Tags: , ,
I've been using the great VPN software OpenVPN for a long time now. I just love it. Today, I copied the configuration of my old router to my brand new Fedora 15 box, and suddenly it can't start anymore. In the logs I found this message: script failed: could not execute external program What does that mean? Is the 'up' script not found? It it in the wrong directory? I could not just find it. Until I hooked up my favourite debugger tool: strace. And look what I found there: [pid 8273] execve("./up", ["./up", "vpn", "1500", "1576", "", "", "init"], [/* 14 vars */]) = -1 ENOEXEC (Exec format error)

Solution

What is the case? In older OpenVPN versions, scripts where run by system(3), which uses the shell to run scripts. Newer versions are more secure, and use execl/execve or something like that. That means that shell scripts must explicitly tell the sytem that they're to be run by the shell. So, add the following line to the top of the script: #!/bin/bash And you're done.© GeekLabInfo

Was this page useful?

Please rate this page and/or leave a comment.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.00 out of 5)
Loading ... Loading ...

One Comment

  1. Christopher says:

    This saved my ass, thanks for the tip it doesn't help when the ubuntu How-To page office.up script contains
    # office.up
    #!/bin/sh

    https://help.ubuntu.com/community/VPNServer/

Leave a Reply

Pages

Search

Tags

3com 4250T 5216k access point acpi Acrobat Active Directory AD ad-hoc wifi Adobe Apache Asterisk Asterisk 1.8 autorepair backdoor barcode bash bat batch Belkin bios bootloader CentOS CentOS 5 CentOS 6 certificates checksum cmos console access cookies CUPS database databases Dead default password Dell dhcp digital invoice dns dnsmasq dovecot Dymo dynamic dns dyndns e-commerce EAN13 Esx Esx4 Exchange Exchange 2007 fax Fedora Fedora 13 Fedora 15 Fedora 16 Firefox firewall firmware fix FoIP fonts ftp fuckup ghostscript Google Google apps Google Chrome Google Maps Google Talk GPO grub gvfs-open H200 hibernation http hushlogin initrd internet explorer iproute2 iptables IPv6 jQuery KB953297 KB974417 KBsomething KDE Konsole layer8 LDAP ldifde Linux login Lovelock lpd magento mkinitrd mplayer ms office ms office 2010 mysql Nagios networking NetworkManager NoteToSelf NTLM nullmodem nvram Omniview OpenSSL openvpn password patch pcl pdf PERC PHP Postfix PostScript preload printer privacy proxy pstn pureftpd pxe rant reboot RedHat remote remote wipe reset password Review root root access route router rpm Samba Samsung Galaxy S2 scripting securit security SELinux Sendmail SEO Servicetag shutdown SMTP socat software deployment Spam speed-up SQL Server Express squid ssh SSL starttls stupid switch sysinternals syslinux talk tftp thawte Thunderbird Trend Micro updates v4l v4l2 vdr viclient video VMWare VMWare Data Recovery vnc voice voip vpn vSphere vsphere client wbinfo webapps webcam wf.msc wifi winbind Windows Windows 7 Windows 2003 Windows 2008 SBS windows internal database Windows Updates Windows XP wmic WordPress WordPress plugins wscript WSUS wsusutil WYukon