Giter Site home page Giter Site logo

rsenn / minit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jlesage/minit

0.0 1.0 0.0 73 KB

A small init and service supervisor suitable for Docker containers

License: GNU General Public License v2.0

Makefile 5.09% Shell 1.42% Python 1.70% Roff 14.63% C 77.16%

minit's Introduction

Each service gets its own directory under /etc/minit (change this in the
source, it's a #define right at the start of minit.c).

Each service directory can contain the following files/symlinks:

  depends

    a plain text file containing a service name per line.
    Example: /etc/minit/sshd/depends could contain "network".
    Each of these services will be started before this service is
    started.  If you need to wait for static initializations to
    complete, use the sync flag.

  run

    a symbolic link to the program name.  No hard link, because argv[0]
    for the programs is created by extracting the part after the last
    slash in the contents of the symbolic link.
    Example: "/usr/bin/sshd" would be run with argv[0]="sshd".

  params

    a plain text file containing command line parameters for the
    service, one parameter per line.  No shell expansion is done.  If
    you need shell expansion, have run point to a shell script instead
    of the real daemon.  Note: Have the shell script exec the daemon
    instead of simply running it to save system ressources.

  respawn

    touch this file to make minit respawn the process when it dies.
    This should be touched for getty and network servers.

  sync

    touch this file to make minit wait until the service ends.  sync is
    mutually exclusive with respawn.  This is meant for static
    initializations like "ifconfig".

  log

    if this directory exists, it is taken as service and minit creates
    a pipe between stdout of this service and stdin of the log service.
    If the log service can not be started, this service will block if it
    writes to stdout.  File descriptors will be reused, i.e. if the log
    process dies and is restarted, no log entries will be lost and there
    will be no SIGPIPE.

Please see http://cr.yp.to/daemontools/multilog.html for a very good
logging tool.

minit will try to run the command line arguments as services.  The
kernel passes its arguments to init.  That means you can for example
have a service /etc/minit/sos-shell that starts a /bin/sh and then use
LILO to boot "bzImage sos-shell".  minit will then run that service.
If none of the services worked (or none were given), minit will spawn
the service "default".  The normal way to configure minit is to have
default be an empty service and just list all the services you want
minit to start at boot time in default/depends.

Other special services (besides "default") are "ctrlaltdel" and "kbreq".
ctrlaltdel will be run when the console user presses ctrl-alt-del and is
meant to reboot the computer.  kbreq is the keyboard request, which
can be mapped using loadkeys.  On my box, it is on Alt+Arrow-Up.  I use
it to shut down the computer.

minit's People

Contributors

jlesage 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.