chef-boneyard / push-jobs-cookbook

Development repository for Chef Cookbook push-jobs
https://supermarket.chef.io/cookbooks/push-jobs
Apache License 2.0
21 stars 43 forks source link

System V init template should not use basename $0 to name the PID file #143

Closed chris-carr-bose closed 6 years ago

chris-carr-bose commented 6 years ago

Cookbook version

5.1.2

Chef-client version

12.17.44

Platform Details

Amazon Linux AMI release 2015.03 running on EC2

Scenario:

Restart push jobs using /sbin/service utility.

Steps to Reproduce:

  1. Run this cookbook on a platform with SysV init scripts. Run the cookbook in such a way as to start and enable the push-jobs service.
  2. Reboot the system.
  3. Wait for system to finish booting.
  4. Execute "ls /var/run". Note the presence of the file S50chef-push-jobs-client.pid which was written during system start. Note also no other files related to push jobs.
  5. Execute "cat /var/run/S50chef-push-jobs-client.pid". Note the content.
  6. Execute "ps aux | grep push-jobs". Note two processes, one of which with PID matching the content of S50chef-push-jobs-client.pid, the other a child of the one.
  7. Execute "sudo service chef-push-jobs-client stop". Note that the service utility reports that push jobs is "Not running".
  8. Execute "sudo service chef-push-jobs-client start.
  9. Execute "ps aux | grep push-jobs". Note that there are now four processes.
  10. Execute "ls /var/run". Note that S50chef-push-jobs-client.pid and chef-push-jobs-client.pid are both present.
  11. Cat the two files. Note that both PIDs are running processes.

Expected Result:

In step 4, the file should be named "chef-push-jobs-client.pid". In step 9, there should be two processes: a parent and a child. In step 10, there should be only one PID file, and it should be named "chef-push-jobs-client.pid".

Actual Result:

In step 4, the file is named "S50chef-push-jobs-client.pid" In step 9, there are four processes: two parents, and two children. In step 10, there are two PID files, named "chef-push-jobs-client.pid" and "S50chef-push-jobs-client.pid".

tas50 commented 6 years ago

@chris-carr-bose Can you open up a PR to fix this?

chris-carr-bose commented 6 years ago

@tas50 : The build breaks on a number of errors that I don't think have anything to do with my PR. Either way, I'm afraid I won't have time to correct them all any time soon.

tas50 commented 6 years ago

The initial fix here is in 5.3.0. Thanks for the PR