A process inherits an environment from the parent process that
starts it. To change the PATH or other environment values in a
child, we can set a variable to a value in the parent, and export
the variable if we are in a shell, and then start the child
process. The child may also read one or more initialization files
to change its own environment as it starts.
So, there are two more questions to get to an answer:
What is the parent/child inheritance tree that leads to the process
that you want to be affected by the PATH or environment change?
What initialization files are used/read/sourced by the
relevant processes in that tree?
Here is part of the output of ps(1) to show what I mean
by an inheritance tree:
# /bin/ps -o 'uid:5,pid:5,ppid:5,user:4,args' axf
UID PID PPID USER COMMAND
0 1 0 root /usr/lib/systemd/systemd
0 1481 1 root /usr/sbin/gdm-binary -nodaemon
0 1497 1481 root \_ /usr/libexec/gdm-simple-slave ...
0 1504 1497 root \_ /usr/bin/Xorg :0 ...
0 1855 1497 root \_ gdm-session-worker ...
Note the
\_
graphic sequences and the PIP/PPID numbers (Process ID and Parent PID).
PID 1855 was started by (some child of?) 1497, which was started by 1481,
which was started by the PID 1, which was started by the ancestor process 0.
Do a similar inheritance trace for the process you want to affect,
figure out which initialization files are relevant,
and make the change to PATH somewhere in that tree,
probably with something similar to:
PATH=${PATH}:/usr/local/bin