From 6989a070c35b9672683ebb0764ab9051e0650469 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 6 Jan 2018 20:34:37 +0100 Subject: [PATCH] Document how to enable tinc at boot time using systemd. --- doc/tinc.texi | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/doc/tinc.texi b/doc/tinc.texi index c0508fac..545f4c4f 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -3409,6 +3409,7 @@ tinc or give us feedback, you are stronly encouraged to do so. @menu * Interface configuration:: * Routes:: +* Automatically starting tinc:: @end menu @c ================================================================== @@ -3535,6 +3536,67 @@ Adding routes to IPv6 subnets: @tab @code{netsh interface ipv6 add route} @var{network address}/@var{prefixlength} @var{interface} @end multitable +@c ================================================================== +@node Automatically starting tinc +@section Automatically starting tinc + +@menu +* Linux:: +* Windows:: +* Other platforms:: +@end menu + +@c ================================================================== +@node Linux +@subsection Linux + +@cindex systemd +There are many Linux distributions, and historically, many of them had their +own way of starting programs at boot time. Today, a number of major Linux +distributions have chosen to use systemd as their init system. Tinc ships with +systemd service files that allow you to start and stop tinc using systemd. +There are two service files: @code{tinc.service} is used to globally enable or +disable all tinc daemons managed by systemd, and +@code{tinc@@@var{netname}.service} is used to enable or disable specific tinc +daemons. So if one has created a tinc network with netname @code{foo}, then +you have to run the following two commands to ensure it is started at boot +time: + +@example +systemctl enable tinc +systemctl enable tinc@@foo +@end example + +To start the tinc daemon immediately if it wasn't already running, use the +following command: + +@example +systemctl start tinc@@foo +@end example + +You can also use @samp{systemctl start tinc}, this will start all tinc daemons +that are enabled. You can stop and disable tinc networks in the same way. + +If your system is not using systemd, then you have to look up your +distribution's way of starting tinc at boot time. + +@c ================================================================== +@node Windows +@subsection Windows + +On Windows, if tinc is started with the @code{tinc start} command without using +the @code{-D} or @code{--no-detach} option, it will automatically register +itself as a service that is started at boot time. When tinc is stopped using +the @code{tinc stop} command, it will also automatically unregister itself. +Once tinc is registered as a service, it is also possible to stop and start +tinc using the Windows Services Manager. + +@c ================================================================== +@node Other platforms +@subsection Other platforms + +On platforms other than the ones mentioned in the earlier sections, you have to +look up your platform's way of starting programs at boot time. @c ================================================================== @node About us -- 2.20.1