Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jul 2018 13:40:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229473] support /etc/profile.d by default for sh environment snippets
Message-ID:  <bug-229473-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

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@FreeBSD.org
          Reporter: luca@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.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229473-227>