From c3896850f748c4cff3e2a950f6b31f17c25ca141 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 8 Nov 2009 18:41:26 +0100 Subject: add and example of tftpd service Signed-off-by: Denys Vlasenko --- examples/var_service/tftpd/log/run | 21 +++++++++++++++++++++ examples/var_service/tftpd/p_log | 4 ++++ examples/var_service/tftpd/run | 15 +++++++++++++++ examples/var_service/tftpd/w_log | 4 ++++ 4 files changed, 44 insertions(+) create mode 100755 examples/var_service/tftpd/log/run create mode 100755 examples/var_service/tftpd/p_log create mode 100755 examples/var_service/tftpd/run create mode 100755 examples/var_service/tftpd/w_log diff --git a/examples/var_service/tftpd/log/run b/examples/var_service/tftpd/log/run new file mode 100755 index 0000000..560d1b1 --- /dev/null +++ b/examples/var_service/tftpd/log/run @@ -0,0 +1,21 @@ +#!/bin/sh + +user=logger + +logdir="/var/log/service/`(cd ..;basename $PWD)`" +mkdir -p "$logdir" 2>/dev/null +chown -R "$user": "$logdir" +chmod -R go-rwxst,u+rwX "$logdir" +rm logdir +ln -s "$logdir" logdir + +# make this dir accessible to logger +chmod a+rX . + +exec >/dev/null +exec 2>&1 +exec \ +env - PATH="$PATH" \ +softlimit \ +setuidgid "$user" \ +svlogd -tt "$logdir" diff --git a/examples/var_service/tftpd/p_log b/examples/var_service/tftpd/p_log new file mode 100755 index 0000000..a2521be --- /dev/null +++ b/examples/var_service/tftpd/p_log @@ -0,0 +1,4 @@ +#!/bin/sh + +cd log/logdir || exit 1 +cat @* current | $PAGER diff --git a/examples/var_service/tftpd/run b/examples/var_service/tftpd/run new file mode 100755 index 0000000..e492d84 --- /dev/null +++ b/examples/var_service/tftpd/run @@ -0,0 +1,15 @@ +#!/bin/sh + +#exec >/dev/null +exec 2>&1 +exec &1 | cut -b0-$((w-2))' -- cgit v1.1