diff options
author | Denys Vlasenko | 2016-09-20 18:09:00 +0200 |
---|---|---|
committer | Denys Vlasenko | 2016-09-20 18:09:00 +0200 |
commit | d8330ca4a42a7f5d81b233a1cf7cbc7a7bd0be95 (patch) | |
tree | f33ddab6870a14914852ef40c378c31ccd8e2443 /examples/var_service/supplicant_if/log | |
parent | 92d98f0612c147171a0e9e03dd7fdfde890ee9e5 (diff) | |
download | busybox-d8330ca4a42a7f5d81b233a1cf7cbc7a7bd0be95.zip busybox-d8330ca4a42a7f5d81b233a1cf7cbc7a7bd0be95.tar.gz |
examples/var_service/supplicant_if: new service example
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/supplicant_if/log')
-rwxr-xr-x | examples/var_service/supplicant_if/log/run | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/var_service/supplicant_if/log/run b/examples/var_service/supplicant_if/log/run new file mode 100755 index 0000000..69d74b7 --- /dev/null +++ b/examples/var_service/supplicant_if/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 -rf 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" |