Re: Stop and start daemon
Re: Stop and start daemon
- Subject: Re: Stop and start daemon
- From: "Rakesh Singhal" <email@hidden>
- Date: Mon, 12 Jan 2009 19:25:02 +0530
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 <email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden