Skip to content

Add a note to the readme about RVM integration with init scripts #77

jondkinney opened this Issue Oct 13, 2010 · 1 comment

2 participants


If you follow this: and create a wrapper script for bluepill then you can reference that wrapper script "bootup_bluepill" in an init.d script and it will load up the RVM environment properly and "just work".

/etc/init.d/bluepill init script


# Author: Jon Kinney
# Based on the opensuse skeleton /etc/init.d/skeleton init script

# Provides: bluepill
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: bluepill daemon, providing process monitoring
# Description: bluepill is a monitoring tool. More info at

# bootup_bluepill is a wrapper script created based on this info

export PATH="/home/ubuntu/.rvm/gems/ree-1.8.7-2010.02@phatool/bin:/home/ubuntu/.rvm/gems/ree-1.8.7-2010.02@global/bin:/home/ubuntu/.rvm/rubies/ree-1.8.7-2010.02/bin:/home/ubuntu/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

# Check for missing binaries
test -x $BLUEPILL_BIN || { echo "$BLUEPILL_BIN not installed";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

# Check for existence of needed config file and read it
test -r $BLUEPILL_CONFIG || { echo "$BLUEPILL_CONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 6; fi; }

case "$1" in
        echo -n "Starting bluepill "
        bootup_bluepill load $BLUEPILL_CONFIG
        echo -n "Shutting down bluepill "
        bootup_bluepill quit
        # I would have liked to do this ---- kill `cat /srv/www/thedacare/shared/pids/`
        rm /srv/www/thedacare/shared/pids/
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start
        echo "Usage: $0 {start|stop|restart}"
        exit 1
QaDeS commented Jun 1, 2011

Just generating the wrapper should be enough. Bluepill already understands start, stop, restart and status commands, so it's prepared for directly running as a service. Only thing is the INIT INFO section, which should probably go into the wrapper and the bluepill executable to ease the (de-)activation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.