From 1192e2475a0cf5b02810694e48cd58eb1b396198 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 22 Feb 2021 21:56:26 +0100 Subject: Adding /etc/default/ttyd to handle options used to start ttyd via systemd unit. Signed-off-by: Daniel Baumann --- debian/local/default/ttyd | 8 ++++++++ debian/ttyd.README.Debian | 2 +- debian/ttyd.install | 1 + debian/ttyd.service | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 debian/local/default/ttyd create mode 100644 debian/ttyd.install diff --git a/debian/local/default/ttyd b/debian/local/default/ttyd new file mode 100644 index 0000000..a84ec9f --- /dev/null +++ b/debian/local/default/ttyd @@ -0,0 +1,8 @@ +# /etc/default/ttyd + +INTERFACE="-i lo" +PORT="-p 7681" +CHECK_ORIGIN="-O" +COMMAND="login" + +TTYD_OPTIONS="${INTERFACE} ${PORT} ${CHECK_ORIGIN} ${COMMAND}" diff --git a/debian/ttyd.README.Debian b/debian/ttyd.README.Debian index 8e8aaa0..9af0faa 100644 --- a/debian/ttyd.README.Debian +++ b/debian/ttyd.README.Debian @@ -11,7 +11,7 @@ ttyd for Debian - Login mode means that the user gets a login prompt (like getty) where user and password has to be entered. - * See ttyd(1) manpage for the exact options. + * Edit /etc/default/ttyd and check the ttyd(1) manpage for the exact options. -- Daniel Baumann Sun, 21 Feb 2021 17:19:20 +0100 diff --git a/debian/ttyd.install b/debian/ttyd.install new file mode 100644 index 0000000..70f696a --- /dev/null +++ b/debian/ttyd.install @@ -0,0 +1 @@ +debian/local/default/* /etc/default diff --git a/debian/ttyd.service b/debian/ttyd.service index 4e05835..b09578e 100644 --- a/debian/ttyd.service +++ b/debian/ttyd.service @@ -5,7 +5,8 @@ After=network.target systemd-tmpfiles-clean.service [Service] Type=simple -ExecStart=/usr/bin/ttyd -i lo -p 7681 -O login +EnvironmentFile=-/etc/default/ttyd +ExecStart=/usr/bin/ttyd $TTYD_OPTIONS ExecReload=/usr/bin/kill -HUP $MAINPID KillMode=process LimitNOFILE=512 -- cgit v1.2.3