[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Seeking help with OpenVPN scripts and systemd



On Wed, Sep 10, 2014 at 02:01:00PM +0200, Ondřej Surý wrote:
> Alberto,
> 
> I think you might be too deep in sysvinit paradigms how we did (hack)
> things before.

> I personally think that mapping the functionality 1:1 is a wrong
> approach because you will end up in some impossible scenario in the end
> anyway.
> 

Hi Ondřej,

Thanks for the "new" vision.

> I think the better way how to convert openvpn to systemd would be:
> 
> to convert all AUTOSTART= VPNs to openvpn@ enabled instances and all
> other to disabled openvpn@ instances at upgrade time. I guess there
> might be a need to some more subtle tweaking, but I think you can
> autoconvert most of the old configuration this way.
[snip]
> I don't think it's needed to support "I drop new configuration" and it
> get's picked automatically, but if you think it's needed, I think you
> can prepare openvpn.script that would:
> 
> a) make a note which openvpn@ instances are autoconfigured (probably by
> having openvpn-auto@.service)
> b) walk through all AUTOSTART configurations and instantiate
> openvpn-auto@.service for each new configuration (not already managed by
> openvpn@.service
> c) when configuration disappears remove the auto-enabled
> openvpn-auto@.service

Yep, that sounds like a plan.

> In that way you will have:
> 
> openvpn@.service # manually managed
> openvpn-auto@.service # automanaged
> openvpn.service # service script to manage opevpn-auto@.service(s)
> 
> How does that sounds?

Sounds good. Thanks,

Alberto

-- 
Alberto Gonzalez Iniesta    | Formación, consultoría y soporte técnico
mailto/sip: agi@inittab.org | en GNU/Linux y software libre
Encrypted mail preferred    | http://inittab.com

Key fingerprint = 5347 CBD8 3E30 A9EB 4D7D  4BF2 009B 3375 6B9A AA55


Reply to: