# About stopping the chef server instance (v0.7)

**URL:** <https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338>\
**Category:** Chef Infra (archive)\
**Created:** [January 18, 2010, 3:19am UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338 "2010-01-18T03:19:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dikang\_Gu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dikang_gu/32/911_2.png) [@Dikang\_Gu](https://discourse.chef.io/u/Dikang_Gu)\
**Post date:** [January 18, 2010, 3:19am UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338/1 "2010-01-18T03:19:41Z")

</div>

Hi guys,

When I run the “sudo chef-server -c2 -p 4002”, I find that 4 processes are  
started:

stephen@stephen-laptop:~ sudo chef-server -c2 -p 4002 ~ In 8938 stephen@stephen-laptop:~ ps -e | grep ruby  
3426 ? 00:00:07 ruby  
4031 ? 00:02:57 ruby  
4032 ? 00:00:00 ruby  
4033 ? 00:00:00 ruby  
8938 ? 00:00:00 ruby  
8940 ? 00:00:00 ruby  
8941 ? 00:00:00 ruby  
8942 ? 00:00:00 ruby

I know that the 8941 listens to the port 4002, and 8942 listens to 4003,  
but what are the 8938 and 8940 used for?

If I’d like to stop this chef server instance, I have to stop the process  
8940, right? why?

Thanks  
Dikang

---

<div class="post-metadata">

**Author:** ![Dreamcat4](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dreamcat4/32/288_2.png) [@Dreamcat4](https://discourse.chef.io/u/Dreamcat4)\
**Post date:** [January 18, 2010, 10:47am UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338/2 "2010-01-18T10:47:40Z")

</div>

$ pstree | less

To see the chain of process.

I guess chef now defaults to thin server. Previously mongrel.  
(The thin server uses eventmachine to fork its processes.)

The lower number are often started before the higher number.  
So maybe 8938 is the Process Group owner, and you might  
kill that one. But its better to get from the PID file.

Depending the server, (thin, mongrel, unicorn), the pid file will  
look a little bit different.

On Mon, Jan 18, 2010 at 3:19 AM, Dikang Gu [dikang85@gmail.com](mailto:dikang85@gmail.com) wrote:

> Hi guys,
> 
> When I run the "sudo chef-server -c2 -p 4002", I find that 4 processes are  
> started:
> 
> stephen@stephen-laptop:~$ sudo chef-server -c2 -p 4002  
> ~ In 8938  
> stephen@stephen-laptop:~$ ps -e | grep ruby  
> 3426 ? 00:00:07 ruby  
> 4031 ? 00:02:57 ruby  
> 4032 ? 00:00:00 ruby  
> 4033 ? 00:00:00 ruby  
> 8938 ? 00:00:00 ruby  
> 8940 ? 00:00:00 ruby  
> 8941 ? 00:00:00 ruby  
> 8942 ? 00:00:00 ruby
> 
> I know that the 8941 listens to the port 4002, and 8942 listens to 4003,  
> but what are the 8938 and 8940 used for?
> 
> If I'd like to stop this chef server instance, I have to stop the process  
> 8940, right? why?
> 
> Thanks  
> Dikang

---

<div class="post-metadata">

**Author:** ![Dikang\_Gu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dikang_gu/32/911_2.png) [@Dikang\_Gu](https://discourse.chef.io/u/Dikang_Gu)\
**Post date:** [January 18, 2010, 12:01pm UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338/3 "2010-01-18T12:01:32Z")

</div>

Where can I find the PID file?

I have tried that kill the 8940 is correct, it will kill all the processes  
associated to this chef server instance. Kill the 8938 does not work.

And by using "ps aux | grep merb", I find that the 8938 is "merb : master",  
and 8940 is "merb : spawner".

Thanks  
Dikang

On Mon, Jan 18, 2010 at 6:47 PM, dreamcat four [dreamcat4@gmail.com](mailto:dreamcat4@gmail.com) wrote:

> $ pstree | less
> 
> To see the chain of process.
> 
> I guess chef now defaults to thin server. Previously mongrel.  
> (The thin server uses eventmachine to fork its processes.)
> 
> The lower number are often started before the higher number.  
> So maybe 8938 is the Process Group owner, and you might  
> kill that one. But its better to get from the PID file.
> 
> Depending the server, (thin, mongrel, unicorn), the pid file will  
> look a little bit different.
> 
> On Mon, Jan 18, 2010 at 3:19 AM, Dikang Gu [dikang85@gmail.com](mailto:dikang85@gmail.com) wrote:
> 
> > Hi guys,
> > 
> > When I run the "sudo chef-server -c2 -p 4002", I find that 4 processes  
> > are  
> > started:
> > 
> > stephen@stephen-laptop:~$ sudo chef-server -c2 -p 4002  
> > ~ In 8938  
> > stephen@stephen-laptop:~$ ps -e | grep ruby  
> > 3426 ? 00:00:07 ruby  
> > 4031 ? 00:02:57 ruby  
> > 4032 ? 00:00:00 ruby  
> > 4033 ? 00:00:00 ruby  
> > 8938 ? 00:00:00 ruby  
> > 8940 ? 00:00:00 ruby  
> > 8941 ? 00:00:00 ruby  
> > 8942 ? 00:00:00 ruby
> > 
> > I know that the 8941 listens to the port 4002, and 8942 listens to 4003,  
> > but what are the 8938 and 8940 used for?
> > 
> > If I'd like to stop this chef server instance, I have to stop the process  
> > 8940, right? why?
> > 
> > Thanks  
> > Dikang

---

<div class="post-metadata">

**Author:** ![Dreamcat4](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dreamcat4/32/288_2.png) [@Dreamcat4](https://discourse.chef.io/u/Dreamcat4)\
**Post date:** [January 18, 2010, 1:33pm UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338/4 "2010-01-18T13:33:00Z")

</div>

I dont remember precisely.

Look in ./log or ./tmp from the current directory  
Look in the gem dir where chef is installed, like  
1.8/gems/chef-server-0.7.16/tmp  
Look in /var/run, /var/chef/

On Mon, Jan 18, 2010 at 12:01 PM, Dikang Gu [dikang85@gmail.com](mailto:dikang85@gmail.com) wrote:

> Where can I find the PID file?
> 
> I have tried that kill the 8940 is correct, it will kill all the processes  
> associated to this chef server instance. Kill the 8938 does not work.
> 
> And by using "ps aux | grep merb", I find that the 8938 is "merb : master",  
> and 8940 is "merb : spawner".
> 
> Thanks  
> Dikang
> 
> On Mon, Jan 18, 2010 at 6:47 PM, dreamcat four [dreamcat4@gmail.com](mailto:dreamcat4@gmail.com) wrote:
> 
> > $ pstree | less
> > 
> > To see the chain of process.
> > 
> > I guess chef now defaults to thin server. Previously mongrel.  
> > (The thin server uses eventmachine to fork its processes.)
> > 
> > The lower number are often started before the higher number.  
> > So maybe 8938 is the Process Group owner, and you might  
> > kill that one. But its better to get from the PID file.
> > 
> > Depending the server, (thin, mongrel, unicorn), the pid file will  
> > look a little bit different.
> > 
> > On Mon, Jan 18, 2010 at 3:19 AM, Dikang Gu [dikang85@gmail.com](mailto:dikang85@gmail.com) wrote:
> > 
> > > Hi guys,
> > > 
> > > When I run the "sudo chef-server -c2 -p 4002", I find that 4 processes  
> > > are  
> > > started:
> > > 
> > > stephen@stephen-laptop:~$ sudo chef-server -c2 -p 4002  
> > > ~ In 8938  
> > > stephen@stephen-laptop:~$ ps -e | grep ruby  
> > > 3426 ? 00:00:07 ruby  
> > > 4031 ? 00:02:57 ruby  
> > > 4032 ? 00:00:00 ruby  
> > > 4033 ? 00:00:00 ruby  
> > > 8938 ? 00:00:00 ruby  
> > > 8940 ? 00:00:00 ruby  
> > > 8941 ? 00:00:00 ruby  
> > > 8942 ? 00:00:00 ruby
> > > 
> > > I know that the 8941 listens to the port 4002, and 8942 listens to 4003,  
> > > but what are the 8938 and 8940 used for?
> > > 
> > > If I'd like to stop this chef server instance, I have to stop the  
> > > process  
> > > 8940, right? why?
> > > 
> > > Thanks  
> > > Dikang

---

<div class="post-metadata">

**Author:** ![Bryan\_McLellan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_mclellan/32/81_2.png) [@Bryan\_McLellan](https://discourse.chef.io/u/Bryan_McLellan)\
**Post date:** [January 19, 2010, 12:50am UTC](https://discourse.chef.io/t/about-stopping-the-chef-server-instance-v0-7/1338/5 "2010-01-19T00:50:13Z")

</div>

On Mon, Jan 18, 2010 at 4:01 AM, Dikang Gu [dikang85@gmail.com](mailto:dikang85@gmail.com) wrote:

> And by using "ps aux | grep merb", I find that the 8938 is "merb : master",  
> and 8940 is "merb : spawner".

On the topic of merb, I find this pattern usually works

sudo /etc/init.d/chef-server stop  
sudo killall -INT chef-server  
sudo killall -15 chef-server

Folks more familiar with merb have told me it needs the INT signal,  
but it is unclear to me in what order it should come in. If chef is  
running under runit you can also do an 'sv int chef-server' and 'sv  
term chef-server'.

Bryan
