Chef

/etc/init.d/chef-solr on centos doesn't set pidfile correctly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9.16, 0.10.0
  • Fix Version/s: 0.9.20, 0.10.0
  • Component/s: Chef Server
  • Labels:
    None
  • Environment:

    centos 5.3, run_style=init, all redhat

  • Triage Status:
    Triaged

Description

When using run_style=init, the init script for chef-solr (and I think the other daemons) does not use the -P option to start chef-solr. As a result, chef-solr defaults to using /tmp/chef-solr.pid instead of the pidfile specified in /etc/sysconfig/chef-solr or the default in /etc/init.d/chef-solr. Because of this service chef-solr stop/restart fails.

The fix is to add -P "$pidfile" in /etc/init.d/chef-solr in the start() function right before the "$options":

daemon $prog -d -c "$config" -u "$user" -g "$group" -L "$logfile" -P "$pidfile" "&>/dev/null"

Note too that you'll have to chown /var/run/chef to be owned by chef:chef.

Activity

Hide
Chris Chalfant added a comment - 29/Mar/10 2:09 PM - edited

Also need to add -p "$pidfile" to call to killproc in stop() function:

killproc -p "$pidfile" $prog

Show
Chris Chalfant added a comment - 29/Mar/10 2:09 PM - edited Also need to add -p "$pidfile" to call to killproc in stop() function: killproc -p "$pidfile" $prog
Hide
Matthew Kent added a comment - 05/Apr/10 7:45 AM

I'm nearly done 0.8.10 packages and part of those are new init scripts. I'll be submitting them for inclusion in Chef as well.

Show
Matthew Kent added a comment - 05/Apr/10 7:45 AM I'm nearly done 0.8.10 packages and part of those are new init scripts. I'll be submitting them for inclusion in Chef as well.
Hide
Matthew Kent added a comment - 19/Apr/10 4:03 AM

Fixed in CHEF-1130

Show
Matthew Kent added a comment - 19/Apr/10 4:03 AM Fixed in CHEF-1130
Hide
KC Braunschweig added a comment - 19/Apr/11 2:01 AM

This seems to have been dropped back out of chef-solr several versions back and also wasn't setup properly when the chef-expander init script was written. The stop() function is correct, but start() doesn't specify the pidfile like it should.

Show
KC Braunschweig added a comment - 19/Apr/11 2:01 AM This seems to have been dropped back out of chef-solr several versions back and also wasn't setup properly when the chef-expander init script was written. The stop() function is correct, but start() doesn't specify the pidfile like it should.
Hide
KC Braunschweig added a comment - 19/Apr/11 9:57 PM

Re-opening this as it was marked a duplicate of CHEF-1130 but that bug fixed several different issues. This is a regression of this specific issue only.

Show
KC Braunschweig added a comment - 19/Apr/11 9:57 PM Re-opening this as it was marked a duplicate of CHEF-1130 but that bug fixed several different issues. This is a regression of this specific issue only.
Hide
Matthew Kent added a comment - 21/Apr/11 6:38 PM

Apologies for not actually fixing this the first time.

Fixed in both 0.9.16 and master if you could pull from:

https://github.com/mdkent/chef/tree/CHEF-1074
https://github.com/mdkent/chef/tree/CHEF-1074-master

Show
Matthew Kent added a comment - 21/Apr/11 6:38 PM Apologies for not actually fixing this the first time. Fixed in both 0.9.16 and master if you could pull from: https://github.com/mdkent/chef/tree/CHEF-1074 https://github.com/mdkent/chef/tree/CHEF-1074-master
Hide
Daniel DeLeo added a comment - 28/Apr/11 5:39 AM

Fix merged for 0.10. Leaving it open so we'll get to it for 0.9.18

Show
Daniel DeLeo added a comment - 28/Apr/11 5:39 AM Fix merged for 0.10. Leaving it open so we'll get to it for 0.9.18
Hide
Bryan McLellan added a comment - 03/May/11 5:20 PM

Wrong ticket, re-resolving.

Show
Bryan McLellan added a comment - 03/May/11 5:20 PM Wrong ticket, re-resolving.
Hide
Bryan McLellan added a comment - 29/Sep/11 12:38 PM

This patch has been merged to opscode/0.9-stable and will be included in the next release. Thank you for contributing to Chef!

Show
Bryan McLellan added a comment - 29/Sep/11 12:38 PM This patch has been merged to opscode/0.9-stable and will be included in the next release. Thank you for contributing to Chef!
Hide
Bryan McLellan added a comment - 29/Sep/11 1:12 PM

Fixing FixVersion

Show
Bryan McLellan added a comment - 29/Sep/11 1:12 PM Fixing FixVersion

People

Vote (2)
Watch (3)

Dates

  • Created:
    29/Mar/10 1:58 PM
    Updated:
    29/Sep/11 1:12 PM
    Resolved:
    29/Sep/11 1:12 PM