https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235791

            Bug ID: 235791
           Summary: service(8) does not respect login.conf
           Product: Base System
           Version: 11.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: and...@tao11.riddles.org.uk

service(8) sets an empty environment via env -i when invoking rc.d files.

This is wrong, because it's not the same environment that init provides, which
comes from the "daemon" login class in login.conf.

The practical upshot of this is that there is no way (short of modifying the
scripts) to set environment variables that rc.d scripts might need, such as an
HTTP_PROXY setting to allow "service ntpd onefetch" to work on a system behind
a proxy.

Related but possibly less serious: when rc.subr invokes a command under a
specified login class, it sets only the resource limits and not the
environment.

To reproduce:

add HTTP_PROXY=http\c//yourproxyhost\cport/  to the setenv= property of
"default" or "daemon" in login.conf

then observe (from a host with no public connectivity)

# service ntpd onefetch
fetch: https://www.ietf.org/timezones/data/leap-seconds.list: Network is
unreachable

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to