[Bug 229473] support /etc/profile.d by default for sh environment snippets

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 2 13:40:48 UTC 2018


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

            Bug ID: 229473
           Summary: support /etc/profile.d by default for sh environment
                    snippets
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: bugs at FreeBSD.org
          Reporter: luca at lesinigo.it

For automation purposes it would be useful to have a directory where
"environment snippets" could be dropped without risking to interfere with other
stuff on the same system.

Having /etc/profile source /etc/profile.d/*.sh by default would provide such a
facility, just like is being done on other operating systems.

This would make my life as a Puppet user so much easier allowing me reuse the
same code on different operating systems and it would be useful for
package/ports maintainers too.

I tested this snippets at the end of the stock /etc/profile and AFAIK it is
working without any problem with both the standard sh shell and the
ports-installed bash shell:

# source *.sh files from /etc/profile.d if they are readable
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list