Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Xen

Samuli Seppänen schreef op 31-05-2017 19:10:


Hi,

A few months back I looked into exactly this issue. Back then there was
no easy way to make systemd send emails. That is why I still use monit
which has good notification capabilities:




Hi, yes, that sounds pretty awesome!!!

The SystemD thing that Debbie sent me involves making service files that 
then get referenced by other unit files and that get a parameter that 
you can use to customize the script or output of your program.


I have been polling stuff too and I think it is a good system but then I 
am usually not running as a daemon.


Monit sounds like a very good solution.

I'll have a look some time, thank you.


Monit works by polling service states periodically, so some delay is
always involved. Monit can, however, do whatever you want when a 
problem

is encountered and is not limited to just restarting the service.

Combining systemd instantaneous restarts with monit's notifications is 
a

pretty good system imho.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] building for ARM using buildsystem document bug (Closed)

2017-05-31 Thread debbie10t

Sorry .. this should have gone to openvpn-devel.

I went ahead and made the change to the wiki page.

regards


On 31/05/17 16:16, debbie10t wrote:

Hi,

Source: 
https://community.openvpn.net/openvpn/wiki/BuildingUsingGenericBuildsystem#BuildingOpenVPNanditsdependencies 




If you get an error complaining about missing libpam, add 
--disable-plugin-auth-pam to generic/build.vars:


OPENVPN_CONFIG="${EXTRA_OPENVPN_CONFIG:---enable-password-save 
--disable-debug --disable-snappy --disable-plugin-auth-pam}"



This must read:


If you get an error complaining about missing libpam, add 
--disable-plugin-auth-pam to generic/build.vars:


EXTRA_OPENVPN_CONFIG="${EXTRA_OPENVPN_CONFIG:---enable-password-save 
--disable-debug --disable-snappy --disable-plugin-auth-pam}"



Highlight: EXTRA_OPENVPN_CONFIG=..

(It is apparent from build.vars file)

Tested and build successful on ubuntu 16.04 for ARM using:

IMAGEROOT=`pwd`/image-arm CHOST=arm-linux-gnueabi 
CBUILD=x86_64-pc-linux-gnu ./build


(Although, I have no ARM device to test the final binary)

Thanks


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Samuli Seppänen
On 31/05/2017 19:50, Xen wrote:
> David Sommerseth schreef op 31-05-2017 18:28:
>> On 31/05/17 17:05, Xen wrote:
>>> Riccardo Paolo Bestetti schreef op 31-05-2017 16:01:
 It's not OpenVPN you should configure, but your Operating System.
 You should refer to its documentation or its relevant mailing list.
>>>
>>> You can also do:
>>>
>>> # crontab -l | { cat; echo "*/15 * * * * /bin/sh -c 'ifconfig | grep
>>> tun0 > /dev/null || systemctl restart openvn'"; } | crontab
>>>
>>> This will check very 15 minutes whether tun0 is up and if not will use
>>> systemctl to restart openvpn service.
>>>
>>> Not sure what runs on Raspbian.
>>
>> As you use systemctl, that implies systemd.  Then that hack is truly
>> ugly compared to what systemd provides.
> 
> So how can you get systemd to send you emails?
> 
> Can you let it run a script on restart?
> 

Hi,

A few months back I looked into exactly this issue. Back then there was
no easy way to make systemd send emails. That is why I still use monit
which has good notification capabilities:



Monit works by polling service states periodically, so some delay is
always involved. Monit can, however, do whatever you want when a problem
is encountered and is not limited to just restarting the service.

Combining systemd instantaneous restarts with monit's notifications is a
pretty good system imho.

-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Xen

David Sommerseth schreef op 31-05-2017 18:28:

On 31/05/17 17:05, Xen wrote:

Riccardo Paolo Bestetti schreef op 31-05-2017 16:01:

It's not OpenVPN you should configure, but your Operating System.
You should refer to its documentation or its relevant mailing list.


You can also do:

# crontab -l | { cat; echo "*/15 * * * * /bin/sh -c 'ifconfig | grep
tun0 > /dev/null || systemctl restart openvn'"; } | crontab

This will check very 15 minutes whether tun0 is up and if not will use
systemctl to restart openvpn service.

Not sure what runs on Raspbian.


As you use systemctl, that implies systemd.  Then that hack is truly
ugly compared to what systemd provides.


So how can you get systemd to send you emails?

Can you let it run a script on restart?

Regards.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread David Sommerseth
On 31/05/17 17:05, Xen wrote:
> Riccardo Paolo Bestetti schreef op 31-05-2017 16:01:
>> It's not OpenVPN you should configure, but your Operating System.
>> You should refer to its documentation or its relevant mailing list.
> 
> You can also do:
> 
> # crontab -l | { cat; echo "*/15 * * * * /bin/sh -c 'ifconfig | grep
> tun0 > /dev/null || systemctl restart openvn'"; } | crontab
> 
> This will check very 15 minutes whether tun0 is up and if not will use
> systemctl to restart openvpn service.
> 
> Not sure what runs on Raspbian.

As you use systemctl, that implies systemd.  Then that hack is truly
ugly compared to what systemd provides.

Copy the openvpn unit file you want to use to /etc/systemd/system ...
and add this line to that file in the [Service] section:

Restart=on-failure

To enable OpenVPN during boot:  systemctl enable $UNIT_NAME


--
kind regards,

David Sommerseth



signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


[Openvpn-users] building for ARM using buildsystem document bug

2017-05-31 Thread debbie10t

Hi,

Source: 
https://community.openvpn.net/openvpn/wiki/BuildingUsingGenericBuildsystem#BuildingOpenVPNanditsdependencies



If you get an error complaining about missing libpam, add 
--disable-plugin-auth-pam to generic/build.vars:


OPENVPN_CONFIG="${EXTRA_OPENVPN_CONFIG:---enable-password-save 
--disable-debug --disable-snappy --disable-plugin-auth-pam}"



This must read:


If you get an error complaining about missing libpam, add 
--disable-plugin-auth-pam to generic/build.vars:


EXTRA_OPENVPN_CONFIG="${EXTRA_OPENVPN_CONFIG:---enable-password-save 
--disable-debug --disable-snappy --disable-plugin-auth-pam}"



Highlight: EXTRA_OPENVPN_CONFIG=..

(It is apparent from build.vars file)

Tested and build successful on ubuntu 16.04 for ARM using:

IMAGEROOT=`pwd`/image-arm CHOST=arm-linux-gnueabi 
CBUILD=x86_64-pc-linux-gnu ./build


(Although, I have no ARM device to test the final binary)

Thanks

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Xen

Riccardo Paolo Bestetti schreef op 31-05-2017 16:01:

It's not OpenVPN you should configure, but your Operating System.
You should refer to its documentation or its relevant mailing list.


You can also do:

# crontab -l | { cat; echo "*/15 * * * * /bin/sh -c 'ifconfig | grep 
tun0 > /dev/null || systemctl restart openvn'"; } | crontab


This will check very 15 minutes whether tun0 is up and if not will use 
systemctl to restart openvpn service.


Not sure what runs on Raspbian.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Riccardo Paolo Bestetti
It's not OpenVPN you should configure, but your Operating System.
You should refer to its documentation or its relevant mailing list.

Best regards,
Riccardo Paolo Bestetti

-Original Message-
From: Jannis Ohms [mailto:jannis.oh...@ostfalia.de] 
Sent: 31 May 2017 15:43
To: openvpn-users@lists.sourceforge.net
Subject: [Openvpn-users] automatically restart openvpn

hi

how can i configure openvpn to restart after  the service crashes ?
iam running on raspbian

--
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! http://sdm.link/slashdot 
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] automatically restart openvpn

2017-05-31 Thread Joe Patterson
If openvpn crashing is a regular problem, that's very interesting in its
own right, and I'm sure we'd like to know more, and there's nothing much
you can do *within* openvpn to respond when openvpn crashes.

If openvpn is exiting normally and you don't want it to, my guess is that
you could look to the "connect-retry-max" and "auth-retry" config options,
depending on why it's exiting.

And in either case you *could* if you wanted to, kluge your way around it
by wrapping openvpn in a shell script that does something like "while true;
do openvpn..." (though, if you do that, make sure you don't have the
'daemon' option in your config)

-Joe

On Wed, May 31, 2017 at 9:48 AM Jannis Ohms 
wrote:

> hi
>
> how can i configure openvpn to restart after  the service crashes ?
> iam running on raspbian
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Openvpn-users mailing list
> Openvpn-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-users
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


[Openvpn-users] automatically restart openvpn

2017-05-31 Thread Jannis Ohms

hi

how can i configure openvpn to restart after  the service crashes ?
iam running on raspbian

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users