Not a bug

modify $PATH for CC on macOS

shawnkhall 2 years ago updated by Ben Burner 2 years ago 1

I brought this up in the forum as well, but it has gained no traction or response.


I love the "Commands" functionality. It's fantastic. I use it for well over 90% of what I need to do for my clients. But it's not perfect. On macOS I have to enter the complete path for each command which is a waste of time (stuff like '/usr/local/bin/mas list'). That's a PITA.

I'm expanding my tool collection and placing them all within a single folder on the client device. No matter what configuration files I change however, "echo $PATH" always returns "/usr/bin:/bin:/usr/sbin:/sbin". 

I've tried adding a new file in /etc/paths.d and a new record in /etc/paths

I've tried /etc/profile

I've tried modifying the onlogin and prelogin LaunchAgents for SC/CC

I've tried creating a new environment.plist launchagent and assigning the path there

BUG: As far as I can tell, CC does not observe any of the standard methods for modifying the macOS $PATH. Please resolve this to allow me to add my folder to the $PATH so CC will use it.

ConnectWise Control Version:
Server Affected:
Host Client Affected:
Guest Client Affected:
Not a bug

Good morning,

Under the hood, we're using the Java ProcessBuilder class to execute command line commands on the OS X guest. Java sets the environment this object uses to start new processes; as such, /bin/sh runs with the process attributes (including environment) as set by Java.

Since the Control client makes no attempt to alter the ProcessBuilder's environment object, we get the default environment as determined by the Java runtime.

Since this is not a bug, I am going to mark this thread as such. I will, however, register a feature request with development that outlines the functionality described in this post; namely, a FR to implement a method to persistently set environmental variables to be used by remote command processes.