Giter Site home page Giter Site logo

tokiclover / supervision Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 0.0 2.34 MB

Supervision Framework - init-system and service-manager; mirror of https://gitlab.com/tokiclover/supervision

License: Other

Shell 21.27% Makefile 2.88% C 59.79% Roff 15.66% Vim Script 0.40%

supervision's Introduction

Supervision - init-system and service-manager

Full fledged service-manager and init-system capable of replacing a SystemV or BSD like rc init-system like OpenRC. Yet, it's still simple and efficient as ever!

Note: busybox has an integrated runit suite which has the same command line options as runsvdir,sv,runsv,...; so support for this is almost guaranted to function as expected. Just install busybox symlinks, and voila!


DESCRIPTION

Full-featured and yet simple and efficient init-system and service-manager with service dependencies, standard service commands and extra service commands, virtual service and service instances and read-only rootfs support to name a few.

BOOT AND SHUTDOWN STATS:

A comlete system, Linux in this test bed,--with rootfs on LVM(2) on top of dm-crypt LUKS, ZFS on top of dm-crypt LUKS, /(var/)tmp on ZRAM backed devices, a few union filesystem (OverlayFS+SquashFS),--with 52 system services for short, can boot or shut down in 11 seconds thanks to supervision parallel service management! Now if udev is used, add 5 seconds to boot up... or it could be even worse depending on the number of devices. dependencies.

INSTALLATION

./configure --build=x86_64-pc-linux-gnu --libdir=/lib64

- add `--enable-sysvinit` to get an additional sysvinit compatibility service;
- add `--enable-runit` to get Runit init-stage-[123]; and likewise
- add `--enable-s6` for S6 init-stage-[123]; and then
- (other standard options are available, see `--help`);
- WARNING: this package should be istalled in a non prefixed installation, so,
avoid using `--libdir=/usr/lib64` or similar to have system utilities in rootfs;

make -j2 to build; and finaly

make DESTDIR=/tmp installl to install.

And do not forget to run ${LIBDIR}/sv/sbin/sv-config --config ARG afterwards! Or, if updating an old installation do not forget to run ${LIBDIR}/sv/sbin/sv-config --update afterwards!

If runit was enabled, copy /usr/share/supervision/runit to /etc; If s6 was enabled, copy /usr/share/supervision/s6 to /etc.

APPLICATION USAGE

The recommanded way to use this package for service management is to use ${LIBDIR}/sv/sh/sv-rc.sh --(sysinit|default|shutdown) to start particular init stage or runlevel when using a supported supervisor. Or else, sv-rc(8) like any SystemV or BSD like system rc(8).

And then use sv-run [OPTIONS] SERVICE COMMAND [ARGUMENTS] to manage particular services; or rather use ${LIBDIR}/sv/sbin/service [OPTIONS] SERVICE COMMAND for SystemV compatibility.

NOTE: That symlink can be copied or moved to ${EXEC_PREFIX}/sbin if necessary to ease administration and if there is no other SystemV binary installed in the system.

Or else, use the magic svscan mode to supervise /service/ and then set SV_SYSTEM="supervision" in /etc/sv.conf configuration file and finaly use sv-rc default to supervise daemons.

Support for containrization solutions or subsystems is available via keywords usage (see KEYWORDS subsection in supervision(5) and /etc/sv.conf for more information) for docker, LXC, jail, systemd-nspawn, UREFIX installation, supervision, UML, VServer and XEN.

Either the subsystem will be auto detected or use /etc/sv.conf to set a particular subsystem with SV_SYSTEM="${SUBSYSTEM}" configuration variable... SV_SYSTEM="supervision" for daemon supervision only; SV_SYSTEM="prefix" for an isolated chrooted environment; SV_SYSTEM="docker" for docker containers et al. Services that have the subsystem keyword will not be started in that particular subsystem environment.

To have the supervisor ({damontools[-encore],runit,s6}) executed as PID 1... Just setup the container or subsystem; once done, use something like the following for docker: docker run [OPTIONS] --env container=docker --tmpfs /run IMAGE /lib64/sv/sh/sv-init.sh --default or; and voila! the supervisor will be executed as PID 1 and another process will handle service management to setup the container.

And then... a bit more, new supervision services can be easily added by running ${LIBDIR}/sv/sbin/sv-config [--log] ${SERVICE} new (--log argument would add a log directory for the service); and then edit /etc/sv/${SERVICE}/OPTIONS before launching the service.

See supervision(5), sv-rc(8), sv-shutdown(8) and or sv-run(8) man page for more information.

REQUIREMENTS

Supervision requires standard coreutils, grep, procps, sed and a (POSIX) shell. POSIX shell compliance is not enforced because it should not be especially when using OpenBSD version of ksh, see builtins(8) manual page for more information. Otherwise, everything was tested with bash and zsh and work as expected.

Optional SysVinit for compatibilty with SysVinit's utilities is supported. Else, sv-shutdown(8) has a BSD like shutdown(8), reboot(8), halt(8) and poweroff(8) behaviour than the SysVinit utilities.

CONTRIBUTORS

Thanks to:

Avery Payne (original supervision-scripts); And others.

LICENSE

Distributed under the 2-clause/new/simplifed BSD License


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.