Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup for 2/5/2009: Looking for processes with pgrep & pkill

David Stevenson
Thursday, February 5, 2009

Interesting Things

  • pgrep is a sweet tool for finding processes. You can find all your mongrels, for example, without having the problems of running ps aux | grep ruby. It’s in the proctools package on most linux/unix operating systems. For example, on osx use sudo port install proctools
  • kill -482 kills all processes in the group 482. This is great for killing all the children of a daemon like mysql or backgroundrb. ps shows the process group id next to the process id.
  • monit doesn’t have great support for figuring out what happens when a start/stop command runs. It can fail silently, for example. One (bad) way of debugging this is to add echo to dump debugging info to a temporary file before and after these commands. Rumor has it that god doesn’t have these problems…
  • we’ve heard a rumor that Marshal.dump(object) uses a temporary file on disk! This would be slower than it needed to be. Perhaps this is to deal with dumping objects to large to fit in RAM?
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

2 Comments

  1. Brian Jenkins says:

    (on linux) you can get the pgroup of a process with pid 555 like this:

    ps h -o pgrp 555

    (-o selects the columns to display, h suppresses column headers.)

    February 6, 2009 at 1:55 am

  2. coderrr says:

    pgrep/pkill -f is awesome for substring matching

    February 8, 2009 at 5:07 pm

Add New Comment Cancel reply

Your email address will not be published.

David Stevenson

David Stevenson
San Francisco

Recent Posts

  • 03/13/13: [SF] Use postgres!
  • Standup for 2/9/2012: NP in P time? As usual, no.
  • Standup 2/6/2012: Tracker UI updates
Subscribe to David's Feed

Author Topics

agile (10)
devise (1)
ec2 (1)
engines (1)
ios (1)
activerecord (3)
inverse_of (1)
css (2)
engineyard (1)
iphone (3)
rubymine (1)
rails (5)
aws (1)
javascript (1)
xmpp (1)
gogaruco (3)
activeresource (1)
heroku (1)
solr (1)
bug (1)
patch (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >