3 ;;; systemd service configuration for the main tripe server.
5 ;;; (c) 2014 Mark Wooding
8 ;;;----- Licensing notice ---------------------------------------------------
10 ;;; This file is part of Trivial IP Encryption (TrIPE).
12 ;;; TrIPE is free software: you can redistribute it and/or modify it under
13 ;;; the terms of the GNU General Public License as published by the Free
14 ;;; Software Foundation; either version 3 of the License, or (at your
15 ;;; option) any later version.
17 ;;; TrIPE is distributed in the hope that it will be useful, but WITHOUT
18 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with TrIPE. If not, see <https://www.gnu.org/licenses/>.
26 Description=Tripe virtual private network server
27 Documentation=man:tripe(8)
29 ConditionPathExists=@sbindir@/tripe
30 ConditionPathExists=@bindir@/tripectl
32 After=syslog.target network.target
35 WantedBy=multi-user.target
39 PIDFile=/var/run/tripectl.pid
41 ExecStart=/bin/sh -e -c ' \
44 case $${syslogp-nil} in nil) ;; *) logopt="$$logopt -l" ;; esac && \
45 case $${logfile+t},$${syslogp-nil} in \
46 t,*) logopt="$$logopt -f$$logfile" ;; \
47 ,nil) logopt="$$logopt -f@logfile@" ;; \
49 exec @bindir@/tripectl -D -s -p@sbindir@/tripe \
50 -P/var/run/tripectl.pid \
52 $${keytag+-S-t$$keytag} \
53 $${addr+-S-b$$addr} $${port+-S-p$$port} \
54 $${user+-U$$user} $${group+-G$$group} \
55 $${sockmode+-S-m$$sockmode} \
56 $${trace+-S-t$$trace} \
57 $${tunnel+-S-n$$tunnel} \
60 ExecReload=@bindir@/tripectl RELOAD
61 ExecStop=@bindir@/tripectl QUIT
63 ExecStartPre=/bin/sh -e -c ' \
64 if { test -f /proc/misc && grep -q tun /proc/misc; } || \
69 echo >&2 "tripe needs the TUN/TAP driver"; exit 1; \
71 if test -c /dev/net/tun; then \
74 echo >&2 "tripe needs /dev/net/tun, which is missing"; \
78 ExecStartPost=/bin/sh -e -c ' \
79 for i in 1 2 3 4 give-up; do \
80 @bindir@/tripectl HELP >/dev/null 2>&1 && break; \
84 give-up) echo >&2 "tripe daemon failed to start"; exit 1 ;; \