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.
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/
Thank you!! one more saved by you
THX MAN !