[yocto] Start openvpn with my own config at startup

Alex J Lennon ajlennon at dynamicdevices.co.uk
Wed May 27 11:55:56 PDT 2015


Hi Matthew,

On 27/05/2015 20:07, Matthew Karas wrote:
> I have an ovpn file I'd like my system to start up with.  I was able
> to install the openvpn file into /etc/openvpn using a bbappends file -
> but the system doesn't start openvpn like the openvpn docs describes.
>
> How do I set up openvpn to launch with my config file at start up?
>
> Thanks

We're using OpenVPN here too. I put a .bbappend together along these
lines which does the job for me. I think you may be needing the
update-rc.d incantations which are documented here

http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-classes-update-rc.d

e.g.

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

SRC_URI += "file://openvpn.conf \
           "

do_install_append() {
  install -d ${D}${sysconfdir}/openvpn
  install -m 644 ${WORKDIR}/openvpn.conf
${D}${sysconfdir}/openvpn/openvpn.conf
}

inherit update-rc.d

INITSCRIPT_NAME = "${PN}"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_PARAMS = "start 90 5 2 . stop 30 0 1 6 ."

...

fwiw we've found that across multiple channels (wired, wireless 802.11,
cellular) we need something more than this and so have started looking
at connman + ofono to provide connection management. NB connman supports
OpenVPN.

Hope that helps,

Alex





More information about the yocto mailing list