site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meg.abyt.es; s=google; h=domainkey-signature:from:to:subject:date:user-agent:references :in-reply-to:reply-by:x-message:mime-version:content-type :content-transfer-encoding:message-id; bh=orKi/XrFNNw3iYUTTguJadIbNbAj7yW/2cH91r7E4fM=; b=NetS8kHyZML75P/6sm0Iz7BNKiV45PrJBYYfZ91usVJ8wgQYFJInnaVI6fuFOYCOKi hn5znVGmrxQBMvCBJPkiIU+vO90HhH7675/n8D+wAsxio5ZedCJ+ewQKHgE1jUrXGq6a iNgOIMAE/AazQ0DID9fumd8qT0TrI39yEIFoQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=meg.abyt.es; s=google; h=from:to:subject:date:user-agent:references:in-reply-to:reply-by :x-message:mime-version:content-type:content-transfer-encoding :message-id; b=Y3LzsvRpSswZsk7RmLVkktq8uKDaByl+Cxm45oirroXke7/h86BwslNxLgtqnUxbUU 1AaCMpP3dkpwjkN0Os9hI7LY0DvGIQbg6S6bRR348J4n4glwPVejSioB7I38q/uqr/uP KdfVs5ZMZ3Ih7w1aYVLMSuZvdTflWguZBnIrA= Reply-by: Wed, 19 Jan 2011 16:20:00 -0600 User-agent: KMail/1.13.5 (Linux/2.6.32-30-server; KDE/4.4.5; x86_64; ; ) On Thursday 24 March 2011 22:36:15 Abhinav Tyagi wrote:
Hi, I am new to background services or agents/daemons. I have been through the apple's technical note TN2083 entitled "Daemons and Agents".
The manpage, in this case, may be a better technical resource, although the Technote certainly provides a lot of context.
I have few doubts such as: (1) i am not able to launch an agent using launchctl in same way as i do launch my daemon. Also when I use LimitLoadToSessionType for agent plist, using launchctl to load the agent from terminal says "nothing to load" while removing this property successfully loads the executable.
As far as I can tell, there is very little difference, technically, between launching a global Agent versus a global Daemon. The differences are generally semantics, only, and it may help the human operator to categorize them separately. In terms of the LimitLoadtoSessionType, what session type are you using, and are you specifying that session type in the '-S' flag to launchctl at the time of load/unload?
(2) on copying the plist to /Library/LaunchAgents however launches the agent successfully and works as desired which i have noticed from system console logs. Does it mean the agents are restricted from launching from the terminal. If yes then whats the logic behind the fact that Daemons are allowed to register with launchd using launchctl but the agents are not?
Are you launching the items as your own user or as user root? Some of the differences may be in terms of binding to ports below 1024, and other privileged operations. Also, unless the user is logged in (via a GUI session), the agents launched for that user generally will not run (but they will be saved in the system to run, when that user next logs in).
(3) And finally the most important thing: we specify sockets in the plist to register with the launchd on which our agent/daemon's request are received. But how is it possible for every person to know if any service is already using that port number or not because it is possible to have an existing daemon loaded and using same port and will be providing services to the applications. Any solution exist for this?
This is why there is no LaunchDaemons in a user's Library directory, only LaunchAgents. You really shouldn't be running a daemon that binds to a specific port, unless you are the system administrator. For other uses, that aren't standard-port driven, you can bind to a random port, then use Bonjour to register that port as a named service. -- Tilghman _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com