site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=FdNLgGwujzq/XVEHI+mK9Ealp3QRJJDVbVs7OfLBXuY=; b=i5kPXqzJ0+VcwGURbbY3ORHKyFk3zHRLMVOUBHMTFi70smb0NF2rrV45BrP6arklH6 NlX7k5g0rUiUvpJJ2Asg0L936v6mquY4m+OP9za6+gllwMEWNaNyjkDw655gvFYbj0Qc 7MmMw7ag7W1hSYh8XT7eCL/odMOHDZ23WeZl4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=orJ/0RVcF/0xUz9O7tj2x9l4UlEuYsWBkq1M5aVR/eNAl/4idSnIXduEQIhlaFdTA0 efFmOeA8VWvt6SO8Vm52YU61pD/gXF6kxiwEIS/cjxK0o0rYtKJ0A4K/mKHE8cpj/yvb MTl6tYMQDHW59mC7x0SWNGRLkiulm9I5iZvQY= Hi Jason, Thanks but I knew this thing. Is there any other way to do the same thing only on the basis of name of daemon application. I think we can not do even by using StartupItems. Regards rksinghal On Mon, Jan 12, 2009 at 7:20 PM, Jason Coco <jason.coco@gmail.com> wrote:
On Jan 12, 2009, at 07:40 , Rakesh Singhal wrote:
Hi all,
I have careted one daemon application and written plist file to launch it at boot time. I have kept plist file in launchAgents folder. Now, if I quit daemon then it will be killed and to launch it again, I should know the path where I kept it.
I want to stop and restart the daemon whenever I need requires without knowing the path of damon. How can I do it? It is ok if I have to do from terminal.
You can do this using launchctl. You use the start and stop commands with launchctl to start and stop the job respectively. You identify the job by the label you gave it in the plist. So, for example, if your job's label is com.somecompany.someapp.daemon and you wanted to stop and then start it (restart), you would do:
launchctl stop com.somecompany.someapp.daemon launchctl start com.somecompany.someapp.daemon
One thing to keep in mind, if your daemon is not a launch agent and is run at boot-time by root, it's not gonna be located in your namespace, so you will have to execute launchctl with sudo in order to locate the job. To see all the jobs running right now, you can use launchctl list. So, to quickly see if your job is running from the terminal:
launchctl list | grep com.somecompany.someapp.daemon
HTH, Jason
_______________________________________________ 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