summaryrefslogtreecommitdiff
path: root/net-misc/endlessh/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-04-25 11:37:10 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-04-25 11:37:10 +0100
commit38423c67c8a23f6a1bc42038193182e2da3116eb (patch)
tree04e2cf4bd43601b77daa79fe654e409187093c5e /net-misc/endlessh/files
parent623ee73d661e5ed8475cb264511f683407d87365 (diff)
gentoo resync : 25.04.2020
Diffstat (limited to 'net-misc/endlessh/files')
-rw-r--r--net-misc/endlessh/files/endlessh-1.1-syslog-help.patch24
-rw-r--r--net-misc/endlessh/files/endlessh.confd-r229
-rw-r--r--net-misc/endlessh/files/endlessh.initd-r230
3 files changed, 83 insertions, 0 deletions
diff --git a/net-misc/endlessh/files/endlessh-1.1-syslog-help.patch b/net-misc/endlessh/files/endlessh-1.1-syslog-help.patch
new file mode 100644
index 000000000000..ec87997d2f23
--- /dev/null
+++ b/net-misc/endlessh/files/endlessh-1.1-syslog-help.patch
@@ -0,0 +1,24 @@
+From 3643683c20774afa1606bae5f1c4ccbfd2a905db Mon Sep 17 00:00:00 2001
+From: "Sam James (sam_c)" <sam@cmpct.info>
+Date: Tue, 21 Apr 2020 08:09:49 +0000
+Subject: [PATCH] Add -s (syslog) to help output
+
+Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
+---
+ endlessh.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/endlessh.c b/endlessh.c
+index adb8ad3..8c3afff 100644
+--- a/endlessh.c
++++ b/endlessh.c
+@@ -530,6 +530,8 @@ usage(FILE *f)
+ fprintf(f, " -m INT Maximum number of clients ["
+ XSTR(DEFAULT_MAX_CLIENTS) "]\n");
+ fprintf(f, " -p INT Listening port [" XSTR(DEFAULT_PORT) "]\n");
++ fprintf(f, " -s Print diagnostics to syslog instead of "
++ "standard output\n");
+ fprintf(f, " -v Print diagnostics to standard output "
+ "(repeatable)\n");
+ fprintf(f, " -V Print version information and exit\n");
+
diff --git a/net-misc/endlessh/files/endlessh.confd-r2 b/net-misc/endlessh/files/endlessh.confd-r2
new file mode 100644
index 000000000000..062e30f0c164
--- /dev/null
+++ b/net-misc/endlessh/files/endlessh.confd-r2
@@ -0,0 +1,29 @@
+# /etc/conf.d/endlessh: config file for /etc/init.d/endlessh
+#
+#default options used by init.d if this is unset
+#ENDLESSH_ARGS="-sv"
+#
+#Usage: endlessh [-vh] [-46] [-d MS] [-f CONFIG] [-l LEN] [-m LIMIT] [-p PORT]
+# -4 Bind to IPv4 only
+# -6 Bind to IPv6 only
+# -d INT Message millisecond delay [10000]
+# -f Set and load config file [/etc/endlessh/config]
+# -h Print this help message and exit
+# -l INT Maximum banner line length (3-255) [32]
+# -m INT Maximum number of clients [4096]
+# -p INT Listening port [2222]
+# -v Print diagnostics to standard output (repeatable)
+# -V Print version information and exit
+
+# EXAMPLE 1: listen on port 22, log all queries and errors in very verbose mode
+#ENDLESSH_ARGS="-p 22 -vv"
+
+# EXAMPLE 2: load settings from config file
+#ENDLESSH_ARGS="-f /etc/endlessh/config"
+
+# EXAMPLE 3: load settings from config file, but override port
+#ENDLESSH_ARGS="-f /etc/endlessh/config -p 22"
+
+# LOGGING: by default is syslog
+# You can add -v (or -vv) for verbosity
+#ENDLESSH_ARGS="-s -v"
diff --git a/net-misc/endlessh/files/endlessh.initd-r2 b/net-misc/endlessh/files/endlessh.initd-r2
new file mode 100644
index 000000000000..0b995f683d91
--- /dev/null
+++ b/net-misc/endlessh/files/endlessh.initd-r2
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ after bootmisc
+ need localmount
+ use clock logger net
+}
+
+description="Starts endlessh tarpit"
+
+command="/usr/bin/endlessh"
+# NOTE: You will need to add -s to ENDLESSH_ARGS in /etc/conf.d/endlessh if modified to keep syslog
+command_args="${ENDLESSH_ARGS:--sv}"
+command_background="true"
+extra_started_commands="dumpstats reload"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+dumpstats() {
+ ebegin "Dumping connection stats of ${RC_SVCNAME} to log"
+ start-stop-daemon --signal SIGUSR1 --pidfile "${pidfile}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME} configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}