GithubHelp home page GithubHelp logo

00mjk / finitd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jemfinch/finitd

0.0 0.0 0.0 104 KB

A small interpreter for more easily writing init scripts.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

finitd's Introduction

Though more documentation should be forthcoming, this basic README
will have to do for now.

I really hate writing init.d scripts.  They're always a bunch of
arcane /bin/sh invocations and I usually find the end results to be
less reliable than the majority of other tools I use.

So instead, I wrote finitd (pronounced "fin it dee" or "eff initd").
It is a configuration file interpreter: you write a basic
configuration file explaining what command you want to run, where you
want to redirect its stdin/stdout, etc. (basically all the options you
would consider writing writing a program which daemonizes itself) and
finitd will interpret that configuration file and act as an init.d
script, with standard start/stop/restart commands (and a few others).

finitd has a few additional features, though.  If configured to
"watch" the process it spawns, it will daemonize, fork and exec the
configured process, and then wait on it, optionally taking action
(such as restarting the process) when the process exits.  This allows
finitd to be a more reliable "babysitter" for processes than many
other such (typically homegrown) programs which grep through `ps`
output, etc.

To do your own experiments with finitd, just run "finitd /dev/null
annotate" and finitd will output an annotated configuration file
showing all the variables and describing their function.  /dev/null
here functions as finitd's configuration file, since that must be the
first argument to finitd.  Alternatively, finitd can receive its
configuration on the command line: finitd /dev/null --help will
explain that.

You can configure additional commands (e.g., for a "graceful" stop, or
a "fullstatus" command) by adding them to the
"finitd.commands.arbitrary" group.  These commands will run in the
same exact environment as all other commands, and so may be useful for
debugging issues with your finitd configuration file: if you want to
see the current directory your finitd script is running in, you can
add the following line to your configuration file:
"finitd.commands.arbitrary.pwd.command: pwd".

finitd's People

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.