launch_msg(): Socket is not connected
Hi all, I am getting this message when i am trying to launch my application which is a LaunchAgent. This message comes only when multiple Users are logged in. This is a small script that i use in my postflight to launch for all the logged in Users for userName in `/usr/bin/users` do echo "launch My_app" su -l $userName -c "launchctl load -S Aqua /Library/LaunchAgents/com.myname.myappname.plist done should i check for anything more than the Users who have logged in so that i can avoid "launch_msg(): Socket is not connected" message.??? thanks, Arjun
Also Please mention if there is any workaround for this issue. alto wrote:
Hi all, I am getting this message when i am trying to launch my application which is a LaunchAgent. This message comes only when multiple Users are logged in. This is a small script that i use in my postflight to launch for all the logged in Users for userName in `/usr/bin/users` do echo "launch My_app" su -l $userName -c "launchctl load -S Aqua /Library/LaunchAgents/com.myname.myappname.plist done
should i check for anything more than the Users who have logged in so that i can avoid "launch_msg(): Socket is not connected" message.???
thanks, Arjun
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev
-- View this message in context: http://www.nabble.com/launch_msg%28%29%3A-Socket-is-not-connected-tp23923855... Sent from the Launchd mailing list archive at Nabble.com.
At 18:44 +0530 8/6/09, Arjun SM wrote:
I am getting this message when i am trying to launch my application which is a LaunchAgent. This message comes only when multiple Users are logged in.
Yeah, your script, as its written, is never going to work. The problem is that, except when run as root, launchctl finds the right launchd to talk to by looking it up in the Mach bootstrap namespace. Your script is always running in one user's namespace, so will always end up talk to that user's launchd (which ends badly because of permissions). The launchd story is a quite weak when it comes to installing and upgrading agents where there are users logged in. This is a well known problem <rdar://problem/5476420> but, alas, I don't have any good news to share with you on this front. This problem breaks down as follows: o upgrade -- There /is/ a reasonable way to handle the upgrade scenario. Most agents are running on behalf of a daemon. In that case you can overwrite the agent on disk and then tell the daemon to signal all of the agents to quit. They will be relaunched by their respective launchd's, this time running the new code. You have to be a little careful, but this approach works reasonably well. o first install -- There isn't a good way to handle the first install case. You can start the agent in the GUI context that you're running in, but starting agents in other existing GUI contexts is tricky. In general I'd recommend you /not/ try to solve this. Non-foreground GUI users will have to log out and log back in to pick up your agent. If that's a problem (for example, you're installing security software), force a restart in that case. Keep in mind that the multiple GUI logins via fast user switching is an edge case that 90% of your users will never encounter. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (3)
-
alto
-
Arjun SM
-
Quinn