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:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=KGg32lm55Zv3Hs40Pj/6oSE2q/HedXrxn1XkxE7YDGA=; b=CGUp46RhBs215q04AXCete9PaAYEEtnhoERuvsKNdfnBR3y93/B+cFeMAs7E82bc0a JTKt7vflI+H47dpU9J2vYqEQnHuLfNsCAKojgZyrcucAindPWjFpSqX3vP/CVKawzaBb W0ymmadoggFvhTaY2osuEZoOkJq1MJH7268kY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=tJTiJxl6gElC/B0J2JGMVPz8FBoKoA8xEHPXUykUGdtMG/CJVt/Q7A6peseNFXO/c+ jpxJ/4R5AawCNdOi7/wklymQOjxLt2DwgDZO3LuEk0Z8qIOyIivzf9RiJ7javlUszsHN 6AcNLmmoUcQyONmYORgee9NE6t2U6F2pVexDU= 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. launchctl stop com.somecompany.someapp.daemon launchctl start com.somecompany.someapp.daemon 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... 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: 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: This email sent to site_archiver@lists.apple.com