Git Product home page Git Product logo

railsweb-rvm-init's Introduction

Debian init script for rails web servers

Yep, here comes another init script for rails-based web servers.

It allows you to:

  • start, stop, restart, and reload unicorn for multiple sites running on the same server;
  • use a separate RVM environment for each specific site;
  • use unicorn, puma, or any other application server;
  • control each site without requiring root permissions (makes it easy to use init script in capistrano deploy process).

Usage:

  • copy railsweb to /etc/init.d/
  • enable it: update-rc.d railsweb defaults
  • create configuration files in /etc/railsweb/ directory

Licensed under MIT license.

railsweb-rvm-init's People

Contributors

knyar avatar hrom512 avatar

Stargazers

 avatar  avatar  avatar Mohammed Saed avatar Joshua Majonis avatar tonilin avatar Luciano Lopes avatar Tim Adler avatar Max Faiko avatar Donny Kurnia avatar Koz@k avatar yzh avatar Yigit C. Bacakoglu avatar  avatar Ilya Nuevo avatar Dmytro Salko avatar andrea avatar Enix Yu avatar Kevin Watt avatar Sergey S. avatar Clay Smith avatar  avatar sk avatar Rojo avatar Markus Strauss avatar Dmitry Krasnoukhov avatar

Watchers

Ilya Nuevo avatar James Cloos avatar  avatar

railsweb-rvm-init's Issues

Distinguish between commands to reopen logs for unicorn

Hey there,

I don't know you'd be willing to add this, since you are writing these scripts for unicorn AND puma.
But for production use - at lease for us - it is important to distinguish between 'USR1' and 'USR2'-signals send to the unicorn.

USR1 will reopen logs - important for log rotation (at least for unicorn, don't know about puma)

USR2 will hot-reload the app and exchange the master (for both puma and unicorn)

Therefore I changed reload to actually send USR2 and added another task reopen like this:

    reopen)
        EXIT_CODE=0
        for SITE in $SITES; do
            unset $CONFIG_VARS
            . $CONFIGPATH/$SITE.conf
            echo -n "Reopening logs for $SITE ... "
            PID=`check_pidfile $RAILS_SERVER $RAILS_SERVER_PID`
            if [[ "$PID" != "0" ]]; then
                kill -USR1 $PID
                if [[ "$?" = "0" ]]; then
                    echo "done"
                else
                    echo "failed"
                    EXIT_CODE=3
                fi
            else
                echo "not running!"
            fi
        done
        exit $EXIT_CODE
        ;;

Perhaps something you might consider?

Cheers, Tim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.