About stopping the chef server instance (v0.7)

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

$ 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 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

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 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 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

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 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 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 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

On Mon, Jan 18, 2010 at 4:01 AM, Dikang Gu 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