You can use strace on a specific pid to figure out what a specific process is doing, e.g.:
strace -fp <pid>
You might see something like:
select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)
| set :rails_env, :production | |
| set :unicorn_binary, "/usr/bin/unicorn" | |
| set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
| set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
| namespace :deploy do | |
| task :start, :roles => :app, :except => { :no_release => true } do | |
| run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
| end | |
| task :stop, :roles => :app, :except => { :no_release => true } do |
| # http://unicorn.bogomips.org/SIGNALS.html | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| rails_root = ENV['RAILS_ROOT'] || "/data/github/current" | |
| God.watch do |w| | |
| w.name = "unicorn" | |
| w.interval = 30.seconds # default | |
| # unicorn needs to be run from the rails root |
| class Book < ActiveRecord::Base | |
| has_many :pages | |
| belongs_to :p2fline | |
| belongs_to :print_profile | |
| belongs_to :publish_profile | |
| acts_as_audited :except => [:name, :file_name] | |
| include AASM | |
| aasm_column :state |
| require 'spec_helper' | |
| describe "HistoryItems" do | |
| before(:each) {login_as :user} | |
| describe "GET /history_items" do | |
| it "works!" do | |
| visit history_items_path | |
| response.should be_success | |
| end | |
| end |
| require 'socket' | |
| socket = UDPSocket.new | |
| socket.send("I am ok.", 0, 'localhost', 1234) | |
| text, sender = socket.recvfrom(16) | |
| socket.close |
| - unless Rails.env.development? | |
| / Require jQuery | |
| = javascript_include_tag 'http://yandex.st/jquery/1.7.1/jquery.min.js' | |
| / Require Google's jQuery if Yandex is down | |
| :javascript | |
| window.jQuery || document.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">\x3C/script>') | |
| / Require local jQuery if Google is down / is development env | |
| :javascript | |
| window.jQuery || document.write('<script src="#{asset_path('jquery.js')}">\x3C/script>') |
| # i hope this helps... | |
| # to set the username and picture send these events to fm | |
| # -> you don't need to define any event handlers | |
| # -> the session token (_session) could be your unique session id | |
| # or the unique user id (it's hashed) | |
| # set the user name | |
| { "_type": "_set_name", "name": "Tingle Tangle Bob", "_session": "mysessiontoken" } |
| namespace :app do | |
| namespace :error_pages do | |
| desc "Generates static pages 500, 403, 404, 422" | |
| task :generate => :environment do | |
| av = ActionView::Base.new | |
| av.class_eval do | |
| include ApplicationHelper | |
| include Rails.application.routes.url_helpers | |
| end |
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |