SystemD Trigger

Guus Sliepen guus at tinc-vpn.org
Tue Mar 1 12:37:05 CET 2016


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>


More information about the tinc mailing list