Giter Site home page Giter Site logo

skatt / erlexec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saleyn/erlexec

0.0 1.0 0.0 654 KB

Execute and control OS processes from Erlang/OTP

Home Page: http://saleyn.github.com/erlexec/

License: Other

Makefile 1.02% C++ 63.65% Erlang 34.14% CSS 1.20%

erlexec's Introduction

erlexec

Build Status

Execute and control OS processes from Erlang/OTP.

This project implements an Erlang application with a C++ port program that gives light-weight Erlang processes fine-grain control over execution of OS processes.

The following features are supported:

  • Start/stop OS commands and get their OS process IDs, and termination reason (exit code, signal number, core dump status).
  • Manage/monitor externally started OS processes.
  • Execute OS processes synchronously and asynchronously.
  • Set OS command's working directory, environment, process group, effective user, process priority.
  • Provide custom termination command for killing a process or relying on default SIGTERM/SIGKILL behavior.
  • Specify custom timeout for SIGKILL after the termination command or SIGTERM was executed and the running OS child process is still alive.
  • Link an Erlang processes to OS processes (via intermediate Erlang Pids that are linked to an associated OS process).
  • Monitor termination of OS processes.
  • Terminate all processes beloging to an OS process group.
  • Kill processes belonging to an OS process group at process exit.
  • Communicate with an OS process via its STDIN.
  • Redirect STDOUT and STDERR of an OS process to a file, erlang process, or a custom function. When redirected to a file, the file can be open in append/truncate mode, and given creation access mask.
  • Run interactive processes with psudo-terminal pty support.
  • Execute OS processes under different user credentials (using Linux capabilities).
  • Perform proper cleanup of OS child processes at port program termination time.

This application provides significantly better control over OS processes than built-in erlang:open_port/2 command with a {spawn, Command} option, and performs proper OS child process cleanup when the emulator exits.

See http://saleyn.github.com/erlexec for more information.

SUPPORTED OS's

Linux, Solaris, MacOS X

DOCUMENTATION

See http://saleyn.github.io/erlexec

BUILDING

Make sure you have rebar (http://github.com/basho/rebar or http://github.com/basho/rebar3) installed locally and the rebar script is in the path.

If you are deploying the application on Linux and would like to take advantage of exec-port running tasks using effective user IDs different from the real user ID that started exec-port, then make sure that libcap-dev[el] library is installed.

OS-specific libcap-dev installation instructions:

  • Fedora, CentOS: "yum install libcap-devel"
  • Ubuntu: "apt-get install libcap-dev"
$ git clone [email protected]:saleyn/erlexec.git
$ make

# NOTE: for enabling optimized build of exec-port, do the following instead:
$ OPTIMIZE=true make

LICENSE

The program is distributed under BSD license. Copyright (c) 2003 Serge Aleynikov

erlexec's People

Contributors

ccrusius avatar davidw avatar egobrain avatar erlanger avatar jbalint avatar noelbk avatar oliv3 avatar pichi avatar pragma1ce avatar puzza007 avatar rikettsie avatar saleyn avatar sanmiguel avatar timclassic avatar vinoski avatar whitfin avatar zenkj avatar

Watchers

 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.