From f5c2f72917e5f75634665f67a6105e1e82ece875 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 8 Nov 2009 00:55:39 +0100 Subject: add more service examples Signed-off-by: Denys Vlasenko --- examples/var_service/ftpd/log/run | 21 +++++++++++++++++++++ examples/var_service/ftpd/p_log | 4 ++++ examples/var_service/ftpd/run | 17 +++++++++++++++++ examples/var_service/ftpd/w_log | 4 ++++ 4 files changed, 46 insertions(+) create mode 100755 examples/var_service/ftpd/log/run create mode 100755 examples/var_service/ftpd/p_log create mode 100755 examples/var_service/ftpd/run create mode 100755 examples/var_service/ftpd/w_log (limited to 'examples/var_service/ftpd') diff --git a/examples/var_service/ftpd/log/run b/examples/var_service/ftpd/log/run new file mode 100755 index 000000000..560d1b19f --- /dev/null +++ b/examples/var_service/ftpd/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/ftpd/p_log b/examples/var_service/ftpd/p_log new file mode 100755 index 000000000..a2521be05 --- /dev/null +++ b/examples/var_service/ftpd/p_log @@ -0,0 +1,4 @@ +#!/bin/sh + +cd log/logdir || exit 1 +cat @* current | $PAGER diff --git a/examples/var_service/ftpd/run b/examples/var_service/ftpd/run new file mode 100755 index 000000000..87b7d2b6c --- /dev/null +++ b/examples/var_service/ftpd/run @@ -0,0 +1,17 @@ +#!/bin/sh + +#exec >/dev/null +exec 2>&1 +exec &1 | cut -b0-$((w-2))' -- cgit v1.2.3