Skip to content

Instantly share code, notes, and snippets.

@josemanuelcarretero
Last active January 19, 2017 18:50
Show Gist options
  • Save josemanuelcarretero/7e2a287044eecf8671d4 to your computer and use it in GitHub Desktop.
Save josemanuelcarretero/7e2a287044eecf8671d4 to your computer and use it in GitHub Desktop.
Openvpn Intel Edison Yocto
cat > /etc/opkg/intel-iotdk.conf <<EOF
src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic
src intel-all http://iotdk.intel.com/repos/1.1/iotdk/all
src intel-quark http://iotdk.intel.com/repos/1.1/iotdk/quark
src intel-i586 http://iotdk.intel.com/repos/1.1/iotdk/i586
src intel-x86 http://iotdk.intel.com/repos/1.1/iotdk/x86
EOF
opkg update
opkg install liblzo2-dev
opkg remove db
opkg remove --force-depends db
rm -rf /tmp/install_openvpn
mkdir /tmp/install_openvpn
cd /tmp/install_openvpn
wget http://download.oracle.com/berkeley-db/db-6.0.20.tar.gz
wget http://www.linux-pam.org/library/Linux-PAM-1.2.1.tar.gz
wget https://swupdate.openvpn.org/community/releases/openvpn-2.3.8.zip
tar xvf db-6.0.20.tar.gz
tar xvf Linux-PAM-1.2.1.tar.gz
unzip openvpn-2.3.8.zip
cd /tmp/install_openvpn/db-6.0.20/build_unix
../dist/configure --enable-dbm
make
make install
cd /tmp/install_openvpn/Linux-PAM-1.2.1
./configure
make
make install
cd /tmp/install_openvpn/openvpn-2.3.8
chmod 755 *
./configure
make
make install
cat > /etc/systemd/system/[email protected] <<EOF
[Unit]
Description=OpenVPN connection to %i
After=network.target
[Service]
PrivateTmp=true
Type=oneshot
RemainAfterExit=yes
PIDFile=/var/run/openvpn_%i.pid
ExecStart=/usr/local/sbin/openvpn --daemon --writepid /var/run/openvpn_%i.pid --cd /etc/openvpn/ --config %i.conf
WorkingDirectory=/etc/openvpn
[Install]
WantedBy=multi-user.target
EOF
########## Start openvpn client ################ -> "/etc/openvpn/client.conf"
# systemctl start [email protected]
########## Start openvpn client ################ -> "/etc/openvpn/client.conf"
# systemctl enable [email protected]
@matbee-eth
Copy link

Trying it out now!

@jgozal
Copy link

jgozal commented Feb 17, 2016

@acidhax did this work for you?

@cjsimon
Copy link

cjsimon commented Sep 24, 2016

Starting the service with systemctl yields in a service masked error. After attempting to unmask the service, no changes are noticed. I've attached a log of my commands.

root@galileo:~# systemctl start [email protected]
Failed to start [email protected]: Unit [email protected] is masked.
root@galileo:~# systemctl unmask [email protected]
root@galileo:~# systemctl enable [email protected]
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment