git: f7ba064978f8 - stable/12 - service(8): set the environment of the "daemon" class before invoking

Kyle Evans kevans at FreeBSD.org
Thu Feb 4 03:15:02 UTC 2021


The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=f7ba064978f84d07cd3ebbcbba3decc8a515cee3

commit f7ba064978f84d07cd3ebbcbba3decc8a515cee3
Author:     Andrew Gierth <andrew at tao11.riddles.org.uk>
AuthorDate: 2020-02-05 04:32:49 +0000
Commit:     Kyle Evans <kevans at FreeBSD.org>
CommitDate: 2021-02-04 03:14:27 +0000

    service(8): set the environment of the "daemon" class before invoking
    
    As mentioned in r357562, this gives the user a single place to configure
    environment variables that need to be used for various services -- the
    "daemon" class -- for, e.g., configuring a system-wide HTTP proxy.
    
    This is a part of D21481.
    
    (cherry picked from commit 736a5a6d1dbbdae68eb102c2ba9c114aafd61821)
---
 usr.sbin/service/service.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh
index fa002fb0a817..42a50fcf61b9 100755
--- a/usr.sbin/service/service.sh
+++ b/usr.sbin/service/service.sh
@@ -165,7 +165,7 @@ cd /
 for dir in /etc/rc.d $local_startup; do
 	if [ -x "$dir/$script" ]; then
 		[ -n "$VERBOSE" ] && echo "$script is located in $dir"
-		exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script "$@"
+		exec env -i -L 0/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@"
 	fi
 done
 


More information about the dev-commits-src-all mailing list