Giter Site home page Giter Site logo

swagdevops / ylem Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 395 KB

Another minimal init system for Unix/Linux containers

License: GNU General Public License v3.0

Shell 8.64% Ruby 90.87% Vim Script 0.50%
init init-system linux unix containers startup-process

ylem's Introduction

Ylem /ˈiːlɛm/ the primordial matter of the universe

Principles

During the Linux startup process, ylem is intended to sequentially execute arbitrary "user scripts" (alphabetically sorted). Moreover ylem provides logging which facilitates startup debugging.

Startup scripts executed through ylem SHOULD be aimed to:

  • create required files and directories
  • setup users and permissions
  • prepare the system to run deamons

For example, ylem COULD start supervisor, to manage daemons, as soon as the system is sufficiently ready.

Create an /etc/ylem/scripts directory and put your bootstraping scripts. Then scripts are executed alphabetically sorted.

Sample of use

In a Dockerfile:

ENTRYPOINT ["dumb-init", "-c", "--", "ylem", "start", "--"]
CMD ["sleep", "infinity"]

Configuration

The configuration uses a YAML syntax and remains in /etc/#{progname}/config.yml, where progname is ylem. Furthermore configuration filepath can be set on the CLI.

Available configuration keys are:

  • scripts.path
    where bootstraping scripts are stored
    default value is: /etc/#{progname}/scripts
  • logger.file
    default value is: /var/log/#{progname}.log
  • logger.level
    default value is: INFO (see: Logger::Severity)
  • environment.file
    default value is: /etc/environment (System-wide environment variables)

Missing configuration keys use default values. Configuration file can be: complete, partial or empty.

Logging

Ylem provides its own logging mechanism, based on Logger. During its init process, each handled script is logged to logger.file. Depending on logger.level only the messages with a level greater or equal will be published to the log file.

Level Format Summary
DEBUG /"BEGIN"/ script started
INFO /".*"/ script message echoed to STDOUT
WARN /".*"/ script message echoed to STDERR
DEBUG /"ENDED \[0\]/" script ended (success)
ERROR /"ERROR \[[0-9]+\]"/ script error

Resources

ylem's People

Contributors

dependabot-preview[bot] avatar swagdevops avatar

Stargazers

 avatar

Watchers

 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.