Giter VIP home page Giter VIP logo

mule's Introduction

Mule is a simple tool to launch a program in different directories and pass
signals to the created children processes. It can be used to run an application
which exists in several versions.

Imagine versions of SuperApp are deployed in /var/superapp/VERSION/bin/superapp
with their respective configuration file in /var/superapp/VERSION/config.json.
You can run all the versions by calling:

$ mule /var/superapp bin/superapp config.json

To send, say, SIGINT to all processes, send it to the Mule process.

At the moment, Mule passes the following signals:

* SIGTERM
* SIGQUIT
* SIGINT
* SIGHUP

# Options

To run the program with specified user and group, use -u or --user and
-g or --group. To detach the process, use -b or --backgound. Finally, -n or
--name overwrites the name of the program.

These options are useful when using Mule in a rc script or similar. Remember
that rc.subr is sending SIGKILL to the processes which cannot be caught. You
would need to write a slightly more complex script with something like the
following code. See rc.subr(8).

#!/bin/sh

daemon="/usr/local/bin/mule -u www -g www -n mule-superapp -b \
        /var/superapp bin/superapp config.json"

. /etc/rc.d/rc.subr

pexp="mule-superapp"

rc_reload=NO

rc_stop() {
    pkill -SIGTERM -f "^${pexp}"
    (pkill -0 -f "^${pexp}" && sleep 1 && pkill -SIGKILL -f "^${pexp}") || true
    if pkill -0 -f "^${pexp}"; then
        exit 1
    fi
}

rc_cmd $1

mule's People

Contributors

tomferon avatar

Watchers

James Cloos avatar  avatar

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.