Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from scatch #292

Closed
defong opened this issue Oct 27, 2014 · 8 comments
Closed

from scatch #292

defong opened this issue Oct 27, 2014 · 8 comments

Comments

@defong
Copy link

defong commented Oct 27, 2014

using chef/ubuntu-14.04

issue

when you just do

chef.run_list = [
  "recipe[nginx::default]"
]

which is like sudo apt-get install nginx

it spins up nginx on localhost:80

but the nginx.pid is never created
you can find the pid using
ps aux | grep nginx

which in turns leading to
sudo service nginx status
displaying its as not running

or any sudo service nginx cmd
as not working as port 80 is already binded

no default file is made for
/var/www/nginx-default/index.html

more of a annoyance then anything else as i was just trying to get my head around chef and nginx

@miketheman miketheman modified the milestone: 2.7.5 Nov 23, 2014
@boffbowsh
Copy link

I fixed this by including the "nginx::repo" recipe first before the main recipe.

@defong
Copy link
Author

defong commented Dec 3, 2014

chef.run_list = [
"recipe[nginx::repo]"
"recipe[nginx::default]"
]

so just doing this will be fine then?

@lightpriest
Copy link

This happened to me as well. When nginx is installed from the normal Ubuntu repositores, it comes with pid path set to /run/nginx.pid. The package starts the service, then the cookbook changes the files so that the pid path is now /var/run/nginx.pid.

It causes /etc/init.d/nginx to lose track of the pid file that actually references the running nginx instance at install time.

There are two ways to work around the issue in a clean way:

  1. As stated by @boffbowsh, including recipe[nginx::repo] in the run_list. The package from the nginx repos use /var/run/nginx.pid like the cookbook does.
  2. Changing the attribute node['nginx']['pid'] if you want to continue using nginx packages from the official dist repo.

@austburn
Copy link

Seems like a fix for this might just be updating this to be:

if platform == 'ubuntu'
   default['nginx']['pid'] = '/run/nginx.pid'
end

*edit: well, probably not that general. I ran into this problem as well. The repo fix worked great. I feel like there should be a more straightforward approach/fix to this problem.

@rmoriz
Copy link
Contributor

rmoriz commented Jun 15, 2015

fix from d2b954e should be more generic and support later versions. Any volunteers who want to find out when Ubuntu started to change it?

@lightpriest
Copy link

@rmoriz Looks like it appeared in 13.04 raring (nginx-common = 1.2.6-1ubuntu3.3). Prior to that, nginx-common <= 1.2.1, used /var/run/nginx.pid.

@iennae
Copy link
Contributor

iennae commented Sep 26, 2017

I think that this was resolved. If it's still a problem with the current version of the cookbook please reopen with additional details.

@iennae iennae closed this as completed Sep 26, 2017
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants