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

pid checks in running? should verify that the process is indeed alive #83

Open
petejkim opened this issue Mar 7, 2014 · 0 comments
Open

Comments

@petejkim
Copy link
Owner

petejkim commented Mar 7, 2014

The following fails after a restart because pid isn't cleaned up correctly on box shut down.

https://github.com/nitrous-io/autoparts/blob/master/lib/autoparts/packages/apache2.rb#L85

      def running?
        pid = Path.var + name + "run" + "httpd.pid"
        pid.exist?
      end

Do something like this instead:

https://github.com/nitrous-io/autoparts/blob/master/lib/autoparts/packages/mongodb.rb#L84

      def running?
        if mongod_pid_file_path.exist?
          pid = File.read(mongod_pid_file_path).strip
          if pid.length > 0 && `ps -o cmd= #{pid}`.include?(mongod_path.basename.to_s)
            return true
          end
        end
        false
      end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant