Created
September 20, 2016 09:52
-
-
Save gabriel-dehan/a3fc08bfeb8dcd9084afbb75f22a0019 to your computer and use it in GitHub Desktop.
Check if a process name is running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AppProcess | |
# - process as a String | |
def self.running?(process) | |
name = "[#{process.first}]#{process[1..-1]}" | |
`ps -ef | grep [s]idekiq`.split("\n").count > 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment