Remove the rscd stuff from the path and then do the ‘which’ ?
The path is fed by the agent, and I can't remove it whatever I do... I have to run which using nexec. I could probably resolve that by launching a remote shell script, but that sucks because I need a version per OS because of the Shebang that can change...
nexec -e sh -c "PATH=\$(echo \$PATH | sed whatever);which openssl"
or source the path from /etc/profile ?
or look for the package name of openssl - that should be the 'default', even if there's some other openssl in whatever path.
That doesn't work either because sh inherits the PATH from the parent shell used by the agent.
This seems to work however:
nexec -e su - root -c "which openssl" | tail -1
However I get the login welcome message and "You have mail" message also, so it's not as clean.
That’s still picking up root’s path though ? so is that right ? so are you looking for what openssl is installed for the os or what openssl is in root’s path ? ☺
Still unsure actually... The Unix team was asked to update the openssl of all their servers, but that's a very "broad" request. There are tons of applications that come with their own version, and also non-standrad ones installed on some severs that we don't want to update. So, we're looking for the "default" one that was installed by the OS.
I’d go the package checking route which you can do w/ native objects hopefully.