Browse Source

added systemd conf/service file

Signed-off-by: lns <matzeton@googlemail.com>
lns 3 years ago
parent
commit
4f11b7b6a0
2 changed files with 50 additions and 0 deletions
  1. 30 0
      contrib/ptunnel-ng.conf
  2. 20 0
      contrib/ptunnel-ng.service

+ 30 - 0
contrib/ptunnel-ng.conf

@@ -0,0 +1,30 @@
+# Do not forget the '=' between options and values
+# for long options e.g. '--option=value'.
+# This is not required nor valid for short options e.g. '-o value'.
+
+#
+# required settings
+#
+
+# chroot to this dir
+PT_CHROOT="/var/lib/ptunnel"
+
+# change user/group
+PT_USER="nobody"
+PT_GROUP="nobody"
+
+#
+# optional settings
+#
+
+# authentication challenge (won't be visible in /proc/*/cmdline)
+#PT_PASSWD="--passwd=changeme"
+
+# magic value protocol identifier (fool IDS/IDP software)
+#PT_MAGIC="--magic=0x41414141"
+
+# destination ip
+#PT_DESTIP="--remote-addr=127.0.0.1"
+
+# destination port
+#PT_DESTPORT="--remote-port=22"

+ 20 - 0
contrib/ptunnel-ng.service

@@ -0,0 +1,20 @@
+[Unit]
+Description=PingTunnel NG Proxy/Server
+After=syslog.target
+
+[Service]
+Type=fork
+EnvironmentFile=/etc/conf.d/ptunnel-ng
+Environment="PT_CHROOT=${PT_CHROOT:/var/lib/ptunnel}"
+Environment="PT_USER=${PT_USER:nobody}"
+Environment="PT_GROUP=${PT_GROUP:nobody}"
+ExecStartPre=mkdir -p ${PT_CHROOT}
+ExecStartPre=chown ${PT_USER}:${PT_GROUP} ${PT_CHROOT}
+ExecStart=/usr/bin/ptunnel-ng \
+	--syslog \
+	--chroot=${PT_CHROOT} --user=${PT_USER} --group=${PT_GROUP} \
+	$PT_PASSWD $PT_MAGIC $PT_DESTIP $PT_DESTPORT
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target