Re: Stop and start daemon
Re: Stop and start daemon
- Subject: Re: Stop and start daemon
- From: Jason Coco <email@hidden>
- Date: Mon, 12 Jan 2009 08:50:57 -0500
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden