Fix order of tincd's initialization.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 18 Aug 2013 20:35:27 +0000 (22:35 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 18 Aug 2013 20:35:27 +0000 (22:35 +0200)
The order in which tinc initialized things was not completely correct. Now, it
is done as follows:

- Load and parse configuration files.
- Create all TCP and UDP listening sockets.
- Create PID file and UNIX socket.
- Run the tinc-up script.
- Drop privileges.
- Start outgoing connections.
- Run the main loop.

The PID file can only be created correctly if the listening sockets have been
set up ,as it includes the address and port of the first listening socket. The
tinc-up script has to be run after the PID file and UNIX socket have been
created so it can change their permissions if necessary. Outgoing connections
should only be started right before the main loop, because this is not really
part of the initialization.


No differences found