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 01/13/2009: daemons, encoding

Abhijit Hiremagalur
Tuesday, January 13, 2009

Ask for Help

“Daemon best practices in Ruby?”

  • We haven’t tried DaemonKit
  • SimpleDaemon is what we currently use, which we suspect of interfering with monit (had problems with multiple instances starting, and process not starting upon reboot).
  • A couple of people suggested looking at Daemonize
  • Always monitor daemons with sanity checks (e.g. memory usage); use Monit or God
  • Roll your own?

“cut doesn’t handle strange characters in large (5GB) text file, are there other unix commands for text file manipulation that are utf-8 compliant?”

  • Try awk/sed maybe
  • Try using od/hexdump to figure out what the weird characters are

UPDATE 01/14/2009: Chad’s corrections

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

7 Comments

  1. Kyle Maxwell says:

    Cut should be locale sensitive. Sed and Awk certainly are. Have you tried anything like:

    LC_ALL=en_US.utf8 cut -n ….

    I’m in the office in row closest to the ping pong table. Find me if you want to ask questions.

    Cheers!

    January 14, 2009 at 11:45 pm

  2. Kyle Maxwell says:

    In other news, what’s wrong with the daemons gem? I’ve used it in the past, and http://blog.rapleaf.com/dev/?p=19 resolves my key complaint.

    January 14, 2009 at 11:46 pm

  3. Chad Woolley says:

    Couple of corrections/comments:

    * We didn’t try DaemonKit
    * SimpleDaemon is what we currently use, which we suspect of interfering with monit (had problems with multiple instances starting, and process not starting upon reboot).

    @Kyle: I had tried the Daemons gem in the past – I forgot about it. However, it does seem too complex – multiple layers of forked out of concern over security, which we don’t care about in this case.

    Our current plan (at the suggestion of Brian Takita) is to write a simple loop in ruby that just drops a pid. He claims this will work fine with monit.

    – Chad

    January 15, 2009 at 2:19 am

  4. Abhijit Hiremagalur says:

    @Chad: Updated the post, sorry :)

    January 15, 2009 at 3:36 am

  5. Joseph Palermo says:

    The problem with “cut” turned out to be we were IN utf8 mode. Our data provider apparently ran out of standard ASCII characters for a single byte field of theirs and started using values above 127. So all the unix tools were seeing these as multi-byte characters and then eating the next character or so.

    Switching the terminal to ASCII mode solved our problems (go figure)

    January 15, 2009 at 6:04 am

  6. Strass says:

    Depending on the complexity of the daemon, EventMachine could be a good choice as well.

    January 15, 2009 at 10:45 am

  7. Tj Holowaychuk says:

    I cant remember what went wrong with daemonize but I remember I could not seem to get it working correctly

    January 15, 2009 at 12:19 pm

Add New Comment Cancel reply

Your email address will not be published.

Abhijit Hiremagalur

Abhijit Hiremagalur
San Francisco

Recent Posts

  • Hash#fetch with confidence
  • Standup 08/05/2010: ‘bundle check’ and Websockets
  • Standup 08/04/2010: Accounting on Rails anybody?
Subscribe to Abhijit's Feed

Author Topics

ruby (3)
bundler (1)
websockets (1)
cucumber (1)
javascript (1)
json (1)
rails (2)
rails3 (1)
rubymine (2)
testing (2)
ey (1)
facebook (1)
imagemagick (1)
jasmine (2)
thor (1)
agile (3)
ajax (1)
css (1)
design (1)
iconv (1)
jquery (1)
utf-8 (2)
character encoding (1)
unicode (1)
acts_as_fu (1)
selenium (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 >