Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an *.ovpn file that works if I type in: sudo openvpn filename.ovpn.

Now I would like to start up OpenVPN when I boot the computer. It's a headless version of Ubuntu 12.04 64-bit if that matters.

I copied filename.ovpn to /etc/openvpn, but it's not starting, even if I run: service openvpn start.

How can I do this?

share|improve this question
    
see: upstart.ubuntu.com/getting-started.html –  mbx Dec 17 '12 at 8:12
    
Have you tried naming your file client.conf? –  user2313067 Feb 18 at 8:52

1 Answer 1

It would be nice to have a un hacker way of doing it, but this will have to do for now.

1) Create file myopenvpn in /etc/init.d/

nano /etc/init.d/myopenvpn

2) Insert into myopenvpn and save:

# OpenVPN autostart on boot script

start on runlevel [2345]
stop on runlevel [!2345]

respawn

exec /usr/sbin/openvpn --status /var/run/openvpn.client.status 10 --cd /etc/openvpn --config /etc/openvpn/client.conf --syslog openvpn

SOURCE: http://www.hackerway.ch/2012/12/11/how-to-auto-start-openvpn-client-in-debian-6-and-ubuntu-12-04/#comment-79

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.