Skip to content
Not unlike cron for AMQP events.
Ruby
Latest commit bd47ff0 Feb 19, 2012 @blt traut is now able to correctly shed privileges in more (all?) cases.
Interesting behavior I expected. Namely, I thought that it should be kosher for
the root user to dip down into an unpriveledge user and that user, so blessed,
should then be able to become root again! Oh, my.

Note especially the old begin/ensure block. traut will now only attempt to drop
privs once the process fork has been made.

Signed-off-by: Brian L. Troutwine <brian@troutwine.us>

README.md

Traut -- a cron-like for AMQP

Unix cron's an ancient program that runs a script dependent on the passage time. Traut's the same way, except it keys off AMQP events instead. Use it to update your Puppet machines or log-rotate if nagios sends a disk-full warning. Significant number of possibilities.

Traut cannot daemonize itself. Use supervisord or similar to daemonize Traut; the code needed to achieve self-daemonization is outside of the core focus of this program.

Installation

Traut is distributed through the RubyGems

gem install traut

You're tasked with providing your own init scripts and configuration files. See the contents of etc/ for an example traut.conf. Note that traut.conf.sample defines a script deploy/app to be run in response to com.carepilot.event.code.review.app events, making its full path /tmp/traut/scripts/deploy/app.

Configuration

The source distribution has an etc/ directory with example configuration.

Use

Run traut from the root of the project like this:

bundle exec bin/traut -C etc/traut.conf

Now, using hare:

$ hare --exchange_name traut --exchange_type topic --route_key whatthesum
--producer "that wasn't so bad"

You should see nothing. Open up another terminal and

$ hare --exchange_name traut --exchange_type topic --route_key 'whatthesum.exited'

Note that the route key is the same as before, save that '.exited' has been appended to it. Listen to this channel if you need notification of success. Run both hare commands in the order presented, notice the second print a json hash.

See the sample configuration file for more details.

Something went wrong with that request. Please try again.