ForeScout deploys but wont auto launch

jche
New Contributor

Hey All!

So ForeScout downloads as a DMG for us which I can get to install properly on machines, but it will not auto launch.

If i install manually (a la double clicking it) it will go through the process, ask me to authenticate, then the icon will show up in the menu bar.

Yet a push only places the app in the applications folder.

I have tried doing a composer with the file change and everything, waited for the app to launch automatically and show up in the menu bar then pushing that package, but nothing helps.

Last ditch effort was to create a script that looks for the app and forces it to autolaunch, but that seems highly inefficient.

Any suggestions?

thanks!

11 REPLIES 11

hkabik
Valued Contributor

Try to add an:

open /Applications/ForeScout.app

To the policy via "Execute Command" under the "Files And Processes" heading.

See if that does it for you.

jche
New Contributor

rats, i was hoping it would be that easy.

the problem now is the following:

  1. the name has a space in it (ForeScout SecureConnector.app) says getinfo, but if i try the command by itself it wont work (nor as an addition to the policy). -error: the files /Applications/ForeScout and /Users/(un)/SecureConnector.app does not exist.
  2. for some reason, opening the application ALWAYS requires authentication (which i dont know how to bypass)
  3. when i authenticate and start the app, it runs as my username AND root

jche
New Contributor

ill try the following, looks promising

open -a Forescout SecureConnector

edit: osascript still bugs for credentials, even when opening it with sudo.

jche
New Contributor

hey @jreinstedler

you got any thoughts on this?
maybe share how you are deploying this now.

jameswaltrip
New Contributor

Hey Justin,

Did you get anywhere with this? I'm running into the same issue.

osascript still bugs for credentials?

Thanks, James

ccataylo
New Contributor

hey was anyone able to get this one working? I'm having the same issue.

jameswaltrip
New Contributor

Yo MacDaddy's,

open /Applications/ForeScout.app did not work for me. I kept banging at it to try to get it to work.

I ended up using the package I made with Composer (Can't remember if I did anything special) and used AutoDMG with the OS 10.11.dmg from Apple and added my Forescout.pkg to the .dmg from the AutoDMG build. 10.11 worked fine with imaging. 10.12 is giving me issues in AutoDMG with the Forescout pkg. but it works as a package via Self Service now. Still testing 10.12 imaging.

Hope that helps. JW

dba_nc
New Contributor III

I dropped the following 2 commands in to Files&Processes, which launched the SC agent and authenticated for osascript silently, after installing the pkg of ForeScout SecureConnector.app created in Composer. Hopefully I quoted out the first command properly but please doublecheck (no errors when I ran it).

Hope this helps!

sudo osascript -e "do shell script "/Library/Application\ Support/ForeScout/startScDaemon.sh" with administrator privileges"

sudo launchctl load /Library/LaunchAgents/com.forescout.secureconnector.agent.plist

Bernard_Huang
Contributor III

Hi,

What is inside the ForeScout/startScDaemon.sh file?

Ronen
New Contributor II

Hey, does anyone found a solution for that? I’m having the same issue...

Ronen
New Contributor II

Hey, I found this script that fixed the issue for me, hope that will help you too:

!/bin/sh
Downloading OSX Update Package to /tmp on the host
curl -o /tmp/update.tgz http://YOUR_SERVER_NAME_OR_IP/SC_packages/update.tgz; sleep 3

Extracting update.tgz to /tmp
tar -zxvf /tmp/update.tgz -C /tmp; sleep 3

Installing SecureConnector as a Daemon/Dissolvable w/ visible/invisible menu bar icon
sudo -S /tmp/Update/Update.sh -t daemon -v 1; sleep 3

Checking/Starting processes in case they did not start on install
daemon_pid=ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-daemon" | awk '{print $2}'
agent_pid=ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-agent" | awk '{print $2}'
daemon_plist=/Library/LaunchDaemons/com.forescout.secureconnector.daemon.plist
agent_plist=/Library/LaunchAgents/com.forescout.secureconnector.agent.plist

if [[ -z "$daemon_pid" && -z "$agent_pid" ]]; then #Starting Daemon process launchctl unload $daemon_plist launchctl load $daemon_plist

Starting GUI process launchctl unload $agent_plist launchctl load $agent_plist
elif [[ ! -z "$daemon_pid" && -z "$agent_pid" ]]; then #Starting GUI process launchctl unload $agent_plist launchctl load $agent_plist
fi

Clean-up a little
sudo rm -rf /tmp/update.tgz /tmp/Update/