On Mon, Feb 29, 2016 at 07:48:45AM -0600, md at rpzdesign.com wrote:> I want to use TIncVPN in a systemd Ubuntu environment. > > But I want other services to run AFTER tinc has started running and has its > tun0 device initialized and ready. > > Does anybody have a suggestion on what I put into the service files so that > they are ExecStart after Tinc has come up at boot time?Add this to tinc's .service file: [Install] WantedBy=network-online.target This is assuming your installation of tinc on Ubuntu has a .service file. Alternatively, if you use ifupdown, start tinc from /etc/network/interfaces, like this: auto vpn iface vpn inet manual tinc-net <netname> Note that you can also configure the IP address of the VPN interface from /etc/network/interfaces, in which case you don't need a tinc-up script anymore. -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20160229/898f3282/attachment.sig>
Gus: Where do I get information about the details of not needing a tinc-up script anymore? (/etc/network/interfaces) Also, after that interface comes up and is ready, only THEN do I want to run other software. What piece of data can I monitor programmatically (C++, python, etc) to know when the interface is up and running ok? What I want to void is having to execute an ifconfig command and then parse the output in a program. Thanks, md On 2/29/2016 9:42 AM, Guus Sliepen wrote:> auto vpn iface vpn inet manual tinc-net <netname> Note that you can > also configure the IP address of the VPN interface from > /etc/network/interfaces, in which case you don't need a tinc-up script > anymore. > > > _______________________________________________ > tinc mailing list > tinc at tinc-vpn.org > http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20160301/5e8a39fc/attachment.html>
On Tue, Mar 01, 2016 at 04:31:13AM -0600, md at rpzdesign.com wrote:> Where do I get information about the details of not needing a tinc-up script > anymore? (/etc/network/interfaces)You can just use the normal /etc/network/interfaces way of configuring the interface, like this: iface vpn inet manual address 192.168.1.1 netmask 255.255.255.0 tinc-net <netname>> Also, after that interface comes up and is ready, only THEN do I want to run > other software.During boot, all services that require the network is online are started AFTER all auto interfaces in /etc/network/interfaces have been brought up.> What piece of data can I monitor programmatically (C++, python, etc) to know > when the interface is up and running ok? > > What I want to void is having to execute an ifconfig command and then parse > the output in a program.There's /sys/class/net/<interface>/operstate, which should exist and contain "up" when the interface is up. Otherwise, there's the netlink interface, but I've never worked with that myself. But be warned, whether an interface is up still doesn't mean that your network is actually working. For example, you'd want to mount a NFS share if the interface is up AND if the NFS server itself is up and reachable. If you can instead make your services more resilient to changes in the network state, that would be better. -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20160301/01c55ea9/attachment.sig>