We have moved to a new Sailfish OS Forum. Please start new discussions there.
2

start Openvpn in rc.local always ask connection

asked 2014-10-27 22:44:41 +0200

Luca gravatar image

updated 2014-10-27 23:26:09 +0200

Hi all, I need to start openvpn client in background when starting phone.

At the moment the faster solution I found is to add in rc.local :

        #!/bin/sh
        openvpn /etc/openvpn/client.conf &

and to set rc.local executable.
It works fine after a reboot but there is a issue, If the phone has no available internet connection (or If I don't want it to connect) it appears the "connection popup" (I don't know it's name) asking me to select a network connection. This is very annoying.
I'd like to keep openvpn running in background. It by default check with a certain interval to connect so when connection goes on it can connect by itself and it can disconnect when connection goes down.
Is there a way to avoid the asking of connection for specific applications?
If no, is there an alternative to start openvpn in background?

Thanks

Luca

edit retag flag offensive close delete

Comments

can't you just create RPM with a script which would just switch openvpn (start/stop), you can then just tap on app icon to switch openvpn

virgi26 ( 2014-10-27 22:59:54 +0200 )edit

As I told, I need it to start at boot time and run in background without "human interaction". This is also useful If I loose the phone. Passing throw my openvpn server I can reach my phone (if connected to a network) wherever it is...

Luca ( 2014-10-27 23:05:44 +0200 )edit

oh yes... i meant it just as an alternative=)

virgi26 ( 2014-10-27 23:14:05 +0200 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2014-10-28 07:15:19 +0200

Nieldk gravatar image

use a systemd service, that executes after network is ready. More info is here. http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

edit flag offensive delete publish link more

Comments

thanks, I'll try.

Luca ( 2014-10-28 08:36:44 +0200 )edit
2

You are free to try my new build of openvpn (you may have a look also at the services there) It should create the necessary systemd scripts, so only minor modifications will be needed. https://build.merproject.org/package/binaries/home:nielnielsen/openvpn?repository=sailfish_latest_armv7hl

Nieldk ( 2014-10-28 09:13:09 +0200 )edit

Hi Nieldk, can you please explain the main differences between Jolla openvpn package and your?

Luca ( 2014-10-28 09:58:31 +0200 )edit

Newer version (latest 2.3.4) and systemd scripts. Otherwise, I dont think much of a difference. You can probably use Jolla and create the systemd scripts manually, alltough, it seems at least Jollas is build without the systemd option for ask-password (which You probably dont need)

Nieldk ( 2014-10-28 10:06:17 +0200 )edit

Ok, thanks. I think systemd script should be what I need. I'm just trying...

Luca ( 2014-10-28 10:07:53 +0200 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2014-10-27 22:44:41 +0200

Seen: 1,297 times

Last updated: Oct 28 '14