Confused about setting $PATH

First of all thanks to all that make homebrew and homebrew-cask possible. Really great :wink:

After following the removal of the “old” openssl formula and referencing it to openssl@1.1 I had a look at including openssl@1.1 in $PATH and got a little confused.

As suggested here I removed openssl by
brew uninstall openssl

After doing that (on the latest macOS 10.15.1):
openssl version
LibreSSL 2.8.3

The homebrew faq state to use
sudo launchctl config user path
to set the path.

But unfortunately
sudo launchctl config user path "/usr/local/bin:/usr/local/sbin:$PATH"
sudo launchctl config user path "/usr/local/bin:/usr/local/opt/openssl@1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin"
both lead to the following after reboot
echo $PATH

This means entries in the /etc/paths are handled before the ones set with sudo launchctl config user path and openssl version is still set to LibreSSL 2.8.3.

So is it still recommended to set the $PATH with
sudo launchctl config user path
and comment out or delete entries in /etc/paths or shall ~/.zshrc be used. But this leads to problems when using brew or formulae in launchd scripts as by default ~/.zshrc is not sourced by them.

So as for what I know there are two ways for making it work:
solution 1
1.1 setting $PATH in ~/.zshrc
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/opt/openssl@1.1/bin:$PATH"
1.2 leave /etc/paths as it is
1.3 source ~/.zshrc in user launchd scripts
1.4 source loggedInUser .zshrc in root launchd scripts

solution 2
2.1 comment out $PATH in ~/.zshrc
#export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
2.2 comment out all entries in /etc/paths
2.3 set $PATH for all users incl. user launchd scripts
sudo launchctl config user path "/usr/local/bin:/usr/local/sbin:/usr/local/opt/openssl@1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin"
2.4 set $PATH for system/root incl. root launchd scripts
sudo launchctl config system path "/usr/local/bin:/usr/local/sbin:/usr/local/opt/openssl@1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Solution 1 and 2 (after reboot) both bring the correct
echo $PATH

And one more question:
Can changes made by sudo launchctl config user/system path activated without reboot by reloading, kickstarting, etc. service?

Thanks for any help in advance

That path is only for GUI apps looking at the title and content

For anything in a terminal zshrc / bashrc / fish.config / whatever is prefered.

O.k., thanks. I implemented and documented it in my scripts.