{"id":13614168,"url":"https://github.com/davmac314/dinit","last_synced_at":"2026-02-27T08:06:26.401Z","repository":{"id":37597285,"uuid":"46341079","full_name":"davmac314/dinit","owner":"davmac314","description":"Service monitoring / \"init\" system","archived":false,"fork":false,"pushed_at":"2026-02-20T08:41:57.000Z","size":3618,"stargazers_count":896,"open_issues_count":25,"forks_count":65,"subscribers_count":14,"default_branch":"master","last_synced_at":"2026-02-20T12:43:39.244Z","etag":null,"topics":["init","init-system","service-management","service-manager"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davmac314.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"davmac314","liberapay":"davmac"}},"created_at":"2015-11-17T10:54:54.000Z","updated_at":"2026-02-20T08:42:01.000Z","dependencies_parsed_at":"2026-01-07T09:06:48.715Z","dependency_job_id":null,"html_url":"https://github.com/davmac314/dinit","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/davmac314/dinit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davmac314%2Fdinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davmac314%2Fdinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davmac314%2Fdinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davmac314%2Fdinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davmac314","download_url":"https://codeload.github.com/davmac314/dinit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davmac314%2Fdinit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T07:54:54.515Z","status":"ssl_error","status_checked_at":"2026-02-27T07:54:49.177Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["init","init-system","service-management","service-manager"],"created_at":"2024-08-01T20:00:57.878Z","updated_at":"2026-02-27T08:06:26.367Z","avatar_url":"https://github.com/davmac314.png","language":"C++","readme":"# Dinit\n\nv0.19.5pre\n\n---\n![Dinit logo](doc/dinit-logo.png)\n---\n\nThis is the README for Dinit, the service manager and init system. It is\nintended to provide an overview; For full documentation please check the manual pages. \nThe impatient may wish to check out the [getting started guide](doc/getting_started.md).\n\nDinit is used as the init system for [Chimera Linux](https://chimera-linux.org/), and is an init\nsystem option for [Artix Linux](https://artixlinux.org/).\n\n---\n\n_Dinit is free software. You may wish to consider [sponsoring Dinit's development](https://github.com/sponsors/davmac314)_.\n\n---\n\n## Contents\n\n1. [Introduction](#introduction)\n    1. [Features](#features)\n    2. [Target platforms](#target-platforms)\n    3. [Other information](#other-information)\n2. [Reporting issues](#reporting-issues)\n3. [Configuring services](#configuring-services)\n    1. [Service types](#service-types)\n    2. [Service description files](#service-description-files)\n4. [Running Dinit](#running-dinit)\n5. [Controlling services](#controlling-services)\n    1. [Service hierarchy and states](#service-hierarchy-and-states)\n    2. [Using dinitctl](#using-dinitctl)\n\n\n## Introduction\n\n_Dinit_ is a service supervisor with dependency support which can also\nact as the system \"init\" program. It was created with the intention of\nproviding a portable init system with dependency management, that was\nfunctionally superior to many extant inits. Development goals include clean design,\nrobustness, portability, usability, and avoiding feature bloat (whilst still\nhandling common - and some less-common - use cases). Dinit is designed to\n_integrate with_ rather than subsume or replace other system software.\n\n\n### Features\n\nDinit can launch multiple services in parallel, with dependency management\n(i.e. if one service's operation depends on another, the latter service will be\nstarted first). It  can monitor the process corresponding to a service, and re-start it\nif it dies, and it can do this in an intelligent way - first \"rolling back\" all dependent\nservices, and restarting them when their dependencies are satisfied. The _dinitctl_ tool can\nbe used to start or stop services and check their state.\n\nDinit is designed to run as either as a system service manager (runs as root,\nuses system paths for configuration) or a user process (runs as a user,\nuses paths in the user's home directory for configuration).\n\n\n### Target platforms\n\nDinit is designed to work on POSIXy operating systems such as Linux and\nOpenBSD. It is written in C++ and uses the [Dasynq](https://davmac.org/projects/dasynq/)\nevent handling library, which was written especially to support Dinit. (Note\nthat a copy of Dasynq is bundled with Dinit, so a separate copy is not\nrequired for compilation; however, the bundled copy does not include the\ndocumentation or test suite).\n\n\n### Other information\n\nSee [doc/COMPARISON](doc/COMPARISON) for a comparison of Dinit with similar\nsoftware packages.\n\nDinit is licensed under the Apache License, version 2.0. A copy of this\nlicense can be found in the [LICENSE](LICENSE) file.\n\nThis software was written by Davin McCall \u003cdavmac@davmac.org\u003e with contributions\nfrom many others. See [CONTRIBUTORS](CONTRIBUTORS).\n\nSee [BUILD](BUILD) for information on how to build Dinit. See the [doc](doc)\ndirectory for information on design, code style, guidelines for contributions, and\nend-user-oriented documentation.\n\nFull documentation for Dinit is available in the form of manual (man) pages:\n- [dinit(8)](https://davmac.org/projects/dinit/man-pages-html/dinit.8.html) - the _dinit_ daemon\n- [dinit-service(5)](https://davmac.org/projects/dinit/man-pages-html/dinit-service.5.html) -\n  service description format and service settings\n- [dinitctl(8)](https://davmac.org/projects/dinit/man-pages-html/dinitctl.8.html) - _dinitctl_, a\n  utility to control the dinit daemon and manage services\n- [dinit-check(8)](https://davmac.org/projects/dinit/man-pages-html/dinit-check.8.html) - _dinit-check_,\n  a utility to check service descriptions for errors/lint\n- [dinit-monitor(8)](https://davmac.org/projects/dinit/man-pages-html/dinit-monitor.8.html) -\n  _dinit-monitor_, a utility to monitor a service and run a command when service state changes\n\nA brief guide to some basic usage is included in the latter part of this README.\n\n\n## Reporting issues\n\nPlease use [Github issues](https://github.com/davmac314/dinit/issues) to report bugs,\nand provide as much information as is necessary to reliably reproduce the issue.\n\nPlease do not file feature requests unless you are working on system integration (eg. you\nare a package maintainer for a distribution that supports Dinit, or you are working to\nprovide Dinit support for a particular distribution) and need to solve a real problem, or\nunless you are willing to provide patches (in this case you can open an issue for discussion -\nin which case please also see the [CONTRIBUTING](doc/CONTRIBUTING) file).\n\n\n## Configuring services\n\nThis section and the following sections are intended as an introductory guide, and to give\na feel for what using Dinit is like. For a complete reference, see the _man_ pages:\n[dinit(8)](https://davmac.org/projects/dinit/man-pages-html/dinit.8.html) and\n[dinit-service(5)](https://davmac.org/projects/dinit/man-pages-html/dinit-service.5.html).\n\n\n### Service types\n\nA \"service\" is nominally a persistent process or system state. The two main\ntypes of service are a _process_ service (represented by a an actual process)\nand a _scripted_ service (which is started and stopped by running a process -\noften a shell script - to completion). There are also _bgprocess_ services (for processes which\nput themselves \"in the background\" by forking), _internal_ services (useful for grouping other\nprocesses or acting as checkpoints), and _triggered_ services (which require an external event\nor trigger to start). See the [dinit-service(5)](https://davmac.org/projects/dinit/man-pages-html/dinit-service.5.html)\nmanual page for details.\n\nMany programs that you might want to run under Dinit's supervision can run\neither \"in the foreground\" or as a daemon (\"in the background\"), and the\nchoice is dictated by a command line switch (for instance the -D and -F\nswitches to Samba's \"smbd\"). Although it might seem counterintuitive,\nthe \"foreground\" mode should be used for programs registered as process\nservices in Dinit; this allows Dinit to monitor the process.\n\n\n### Service description files\n\nDinit discovers services by reading _service description files_. These files\nreside in a directory (`/etc/dinit.d` is the default \"system\" location, with\n`/usr/local/lib/dinit.d` and `/lib/dinit.d` also searched; the default user\nlocation is `$HOME/.config/dinit.d`) and the name of a service description file\nmatches the name of the service it configures.\n\nFor example, a service named \"mysql\" might be configured via the service description\nfile named `/etc/dinit.d/mysql`. Service descriptions are loaded lazily, as needed\nby Dinit; so, this service description file will usually be read when the mysql\nservice is first started.\n\n(An example of a complete set of system service descriptions can be found in\nthe [doc/linux/services](doc/linux/services) directory).\n\nA service description file has a textual format and consists of a number of\nparameter settings. Some examples of the available parameters are:\n\n    type = process | bgprocess | scripted | internal | triggered\n    command = ...\n    stop-command = ...\n    run-as = (user-id)\n    restart = (boolean)\n    logfile = ...\n    pid-file = ...\n    options: ...\n    depends-on: (service name)\n    depends-ms: (service name)\n    waits-for: (service name)\n    \nTypically, a service which runs as a process will use the `command` setting, and include a\n`waits-for` dependency on a number of other services (to ensure that the system is ready\nfor general operation). For example, a service description for `sshd` might look like the following:\n\n    type = process\n    command = /usr/sbin/sshd -D\n    waits-for: syslogd\n    depends-on: loginready\n\nIn this example, `syslogd` and `loginready` are also services (which must have their own service\ndescriptions).\n\nA wide range of service settings and options are available.\nPlease see the [manual page](https://davmac.org/projects/dinit/man-pages-html/dinit-service.5.html)\nfor a full list.\n\n\n## Running Dinit\n\nThe main Dinit executable is called `dinit`.\n\nDinit can run as the system \"init\" - the first process started by the kernel\non boot - which is normally done by linking or copying `dinit` to `/sbin/init`.\nThis is currently supported only on Linux. It requires having suitable service\ndescriptions in place and should be attempted only by those comfortable\nwith low-level system administration and recovery. See [doc/linux](doc/linux) directory for more\ninformation.\n\nDinit can also run as a normal process, and can be started in this case by a\nregular user.\n\nBy default, regardless of whether it runs as a system or user process, Dinit\nwill look for and start the service named \"boot\". This service should be\nconfigured with dependencies which will cause any other desired services to\nstart. You can specify alternative services to start via the `dinit` command\nline (consult the [manual page](https://davmac.org/projects/dinit/man-pages-html/dinit.8.html)\nfor more information).\n\n\n## Controlling services\n\n### Service hierarchy and states\n\nServices can depend on other services for operation, and so form a\ndependency hierarchy. Starting a service which depends on another\ncauses that other service to start (and the first service waits until\nthe latter has started before its process is launched and it is itself\nconsidered started).\n\nServices are considered _active_ when they are not stopped. Services\ncan also be explicitly marked as active (this normally happens when you\nexplicitly start a service). Finally, a service with an active dependent\nis also considered active.\n\nIf a service stops and becomes inactive (i.e. it is not explicitly marked\nactive and has no active dependents) then any services it depends on will\nalso be stopped (becoming inactive) unless they have other active dependents,\nor they were explicitly started and marked active.\n\nWhat this means is that, in general, starting an (inactive, stopped)\nservice and then stopping it will return the system to its prior state -\nno dependencies which were started automatically will be left running.\n\n\n### Using dinitctl\n\nYou can use the \"dinitctl\" utility to start and stop services. Typical invocations\nare:\n\n    dinitctl start \u003cservice-name\u003e\n    dinitctl stop \u003cservice-name\u003e\n    dinitctl release \u003cservice-name\u003e\n    dinitctl status \u003cservice-name\u003e\n    dinitctl list\n\nNote that a _start_ marks the service active, as well as starting it if it is\nnot already started; the opposite of this is actually _release_, which clears\nthe active mark and stops it if it has no active dependent services.\n\nThe _stop_ command by default acts as a release that also causes the service to\nstop. If stopping a service would also require a dependent service to stop, a\nwarning will be issued; the `--force` option will be required to bypass the\nwarning, though it is generally advisable to stop the dependent systems manually\none-by-one - indirectly force-stopping the boot service may cause every service\nto stop, ending user sessions!\n\nWhen run as root, dinitctl (by default) communicates with the system instance of\ndinit. Otherwise, it communicates with a user (personal) instance. This can be\noverridden (using `-u` or `-s` for the user or system instance, respectively), but\nnote that regular users will generally lack the required permission to communicate\nwith the system instance, which is intended to be controlled only by the root user. \n\nHere is an example command for starting a service:\n\n    dinitctl start mysql   # start mysql service\n\nYou can \"pin\" a service in either the stopped or started state, which prevents\nit from changing state either due to a dependency/dependent or a direct\ncommand:\n\n    dinitctl start --pin mysql  # start mysql service, pin it as \"started\"\n    dinitctl stop mysql  # removes activation, service doesn't stop due to pin\n    dinitctl unpin mysql # release pin; service will now stop\n\nYou can pin a service in the stopped state in order to make sure it doesn't\nget started accidentally (either via a dependency or directly) when you are\nperforming administration or maintenance.\n\nCheck the state of an individual service using the \"status\" subcommand:\n\n    dinitctl status mysql\n\nThe output will tell you the current service state; for a running service, it\nmay look something like the following:\n\n    Service: mysql\n        State: STARTED\n        Activation: explicitly started\n        Process ID: 3393\n\nFinally, you can list the state of all loaded services:\n\n    dinitctl list\n\nThis may result in something like the following:\n\n    [[+]     ] boot\n    [{+}     ] tty1 (pid: 300)\n    [{+}     ] tty2 (pid: 301)\n    [{+}     ] tty3 (pid: 302)\n    [{+}     ] tty4 (pid: 303)\n    [{+}     ] loginready (has console)\n    [{+}     ] rcboot\n    [{+}     ] filesystems\n    [{+}     ] udevd (pid: 4)\n    [     {-}] mysql\n\nThe above represents a number of started services and one stopped service\n(mysql). Only the boot service is marked active (`[+]` rather than `{+}`); all\nother services are running only because they are (directly or indirectly)\ndependencies of boot. Services transitioning state (starting or stopping) are\ndisplayed with an arrow indicating the transition direction:\n\n    [[ ]\u003c\u003c   ] mysql     # starting (and marked active)\n    [   \u003e\u003e{ }] mysql     # stopping\n    \nThe brackets indicate the target state, which may not be the state to which\nthe service is currently transitioning. For example:\n\n    [   \u003c\u003c{ }] mysql     # starting, but will stop after starting\n    [{ }\u003e\u003e   ] mysql     # stopping, but will restart once stopped\n\nRemember that a _starting_ service may be waiting for its dependencies to\nstart, and a _stopping_ service may be waiting for its dependencies to stop.\n\nFor a complete summary of `dinitctl` command line options, use:\n\n    dinitctl --help\n\nOr, for more detailed help, check the [manual page for dinitctl](https://davmac.org/projects/dinit/man-pages-html/dinitctl.8.html).\n","funding_links":["https://github.com/sponsors/davmac314","https://liberapay.com/davmac","https://github.com/sponsors/davmac314)_"],"categories":["Uncategorized","C++"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavmac314%2Fdinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavmac314%2Fdinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavmac314%2Fdinit/lists"}