Skip to content

Instantly share code, notes, and snippets.

@gabriel-dehan
Created September 20, 2016 09:52
Show Gist options
  • Save gabriel-dehan/a3fc08bfeb8dcd9084afbb75f22a0019 to your computer and use it in GitHub Desktop.
Save gabriel-dehan/a3fc08bfeb8dcd9084afbb75f22a0019 to your computer and use it in GitHub Desktop.
Check if a process name is running
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