[chef] Re: Re: A weird problem: sudo su www-data -c 'sudo chef-server -C /etc/chef/server.rb -c2 -p 4004" does not work...


Chronological Thread 
  • From: "Scott M. Likens" < >
  • To:
  • Subject: [chef] Re: Re: A weird problem: sudo su www-data -c 'sudo chef-server -C /etc/chef/server.rb -c2 -p 4004" does not work...
  • Date: Tue, 26 Jan 2010 01:06:33 -0800

Hi Dikang,

Two things, 

1) You don't need to use two ports with .8, we don't use openid... if you need more workers, use unicorn... it's your friend and no special sauce required to use it (except it won't work with the chef-server script... )

What I personally did is create an upstart service to handle this, I attached my files, so ideally if you used this... first turn off chef-server or whatever sitting on port 4000... 

put chef-start.sh in /usr/bin
put unicorn.rb in /usr/lib/ruby/gems/1.8/gems/chef-server-0.8.0/
put chef-server.conf in /etc/init 

then type start chef-server

if you want to see what's going on stdout/stderr this configuration drops those in /tmp/unicorn.stdout.log and /tmp/unicorn.stderr.log and sets the workers to 4... adjust as you see fit, but .8 is insanely responsive with 2 workers... 4-8 workers with monit/bluepill and I can't see how you can fail.

2) -c2 failing should be fixed by http://tickets.opscode.com/browse/CHEF-737 are you running a current master? 

Scott

Attachment: chef-start.sh
Description: Binary data

Attachment: chef-server.conf
Description: Binary data

# What ports/sockets to listen on, and what options for them.
listen 4000, :tcp_nodelay => true, :backlog => 1024 
 
# What the timeout for killing busy workers is, in seconds
timeout 3600
 
# Whether the app should be pre-loaded
preload_app false
 
# How many worker processes
worker_processes 4
stderr_path "/tmp/unicorn.stderr.log"
stdout_path "/tmp/unicorn.stdout.log"

On Jan 25, 2010, at 10:39 PM, Dikang Gu wrote:

Is this a bug for chef 0.8 on ubuntu 9.10? 

Because the same command works well on chef 0.7 with ubuntu 9.04...

Dikang

On Tue, Jan 26, 2010 at 2:28 PM, Dikang Gu < "> > wrote:
Hi guys,

I'd like to use a cgi script to start the chef server, and I use a c script to give the "root" permissions to the cgi script (you know this method which can be easily found on the internet ). But it does not work...

And I tried the method:  sudo su www-data -c 'sudo chef-server -C /etc/chef/server.rb -c2 -p 4004" , which means create the chef server on port 4004. And the output of the command is "~ In 4650" which means the server is started at pid 4650, right?

But with no luck, the server is not started at all... why?

And then I tried to run the other command:  sudo su dikang -c 'sudo chef-server -C /etc/chef/server.rb -c2 -p 4004", the "dikang" is my normal user account. And this command worked well and the server on port 4004 is started... What's wrong with the www-data user? 

I'm working on chef 0.8, apache2 and ubuntu 9.10.

Could anyone give me the help please?

Thanks
Dikang
 

!DSPAM:4b5e8e38113671804284693!




Archive powered by MHonArc 2.6.16.

§