From 3edf5e482d25913ea315a9a4fc0a19bf64050be1 Mon Sep 17 00:00:00 2001 From: heretyk Date: Thu, 2 Dec 2004 17:43:35 +0000 Subject: [PATCH] Support for per service umask settings. This solves the problem with possibly different umask settings when starting services at boot time, and by hand. svn-id: @5362 --- rc.d/init.d/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 882cced0..bf7409de 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -490,10 +490,12 @@ daemon() [ -n "$limits" ] && eval `echo "$limits" | awk 'BEGIN {RS="[\n-]";} !/^ *$/ { printf("ulimit -%s ;", $0); }'` + [ -z "$DEFAULT_SERVICE_UMASK" ] && DEFAULT_SERVICE_UMASK=022 + # And start it up. busy cd / - if errors=$(USER=root HOME=/tmp TMPDIR=/tmp nice -n ${SERVICE_RUN_NICE_LEVEL:-$DEFAULT_SERVICE_RUN_NICE_LEVEL} initlog -c "$prog" 2>&1); then + if errors=$(umask ${SERVICE_UMASK:-$DEFAULT_SERVICE_UMASK}; USER=root HOME=/tmp TMPDIR=/tmp nice -n ${SERVICE_RUN_NICE_LEVEL:-$DEFAULT_SERVICE_RUN_NICE_LEVEL} initlog -c "$prog" 2>&1); then if [ -n "$waitname" -a -n "$waittime" ]; then # Save basename. base=$(basename "$waitname") -- 2.44.0