website

My personal website
git clone git://git.ckyln.com/website
Log | Files | Refs

commit 01ad00be29b9da4f7db8c1f259e0966a3c2e1a50
parent 179ba1f42c4e5ed613e1670222d611c24ba05263
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 10 Oct 2020 13:31:32 +0300

add sysmgr docs

Diffstat:
Mdocs/blog.html | 1+
Mdocs/blog/20200413-editor-wizardry.html | 1+
Mdocs/blog/20200508-why-i-dislike-arch-and-gentoo.html | 1+
Mdocs/blog/20200812-starting-x-without-xinit.html | 1+
Mdocs/blog/20200828-static-linking.html | 1+
Mdocs/blog/20200828-wpa-add-script.html | 1+
Mdocs/blog/20200908-trust-in-distributed-environments.html | 1+
Mdocs/blog/20201002-reimplementing-sysmgr-in-c.html | 1+
Mdocs/contact.html | 1+
Mdocs/index.html | 1+
Mdocs/rss.xml | 2+-
Mdocs/software.html | 3++-
Mdocs/software.txt | 4++--
Adocs/sysmgr/index.html | 110+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adocs/sysmgr/index.txt | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/rss.xml | 2+-
Msrc/software.md | 4++--
Asrc/sysmgr/index.md | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtemplate.html | 1+
19 files changed, 273 insertions(+), 7 deletions(-)

diff --git a/docs/blog.html b/docs/blog.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200413-editor-wizardry.html b/docs/blog/20200413-editor-wizardry.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200508-why-i-dislike-arch-and-gentoo.html b/docs/blog/20200508-why-i-dislike-arch-and-gentoo.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200812-starting-x-without-xinit.html b/docs/blog/20200812-starting-x-without-xinit.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200828-static-linking.html b/docs/blog/20200828-static-linking.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200828-wpa-add-script.html b/docs/blog/20200828-wpa-add-script.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20200908-trust-in-distributed-environments.html b/docs/blog/20200908-trust-in-distributed-environments.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/blog/20201002-reimplementing-sysmgr-in-c.html b/docs/blog/20201002-reimplementing-sysmgr-in-c.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/contact.html b/docs/contact.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/index.html b/docs/index.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> diff --git a/docs/rss.xml b/docs/rss.xml @@ -9,7 +9,7 @@ <description>Personal blog/website on Linux/tech/nerdy stuff</description> <link>https://cemkeylan.com</link> <atom:link href="https://cemkeylan.com/rss.xml" rel="self" type="application/rss+xml" /> - <lastBuildDate>Sat Oct 10 2020 09:00</lastBuildDate> + <lastBuildDate>Sat Oct 10 2020 10:00</lastBuildDate> <item> <title>Reimplementing `sysmgr` in C</title> <pubDate>Fri, 02 Oct 2020</pubDate> diff --git a/docs/software.html b/docs/software.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr> @@ -49,7 +50,7 @@ git repository, some of them are on <a href="https://github.com/cemkeylan">GitHu <li><a href="https://carbslinux.org">Carbs Linux</a> a Linux distribution aimed for simplicity.</li> <li><a href="https://git.carbslinux.org/cpt">Carbs Packaging Tools</a> a portable package management toolchain written with extensibility in mind.</li> -<li><a href="https://git.ckyln.com/sysmgr">sysmgr</a> a POSIX sh service supervisor for Linux systems similar to Runit.</li> +<li><a href="/sysmgr">sysmgr</a> a simplistic service supervisor inspired from runit.</li> <li><a href="https://git.ckyln.com/shinit">shinit</a> a POSIX sh init daemon with support for acting upon signals.</li> <li><a href="https://git.ckyln.com/sxss">sxss</a> Simple X ScreenSaver written in C99.</li> <li><a href="https://github.com/cemkeylan/mu-wizard">mu-wizard</a> Email configuration wizard for setting up mu4e on Emacs.</li> diff --git a/docs/software.txt b/docs/software.txt @@ -7,7 +7,7 @@ git repository, some of them are on [GitHub]. - [Carbs Linux] a Linux distribution aimed for simplicity. - [Carbs Packaging Tools] a portable package management toolchain written with extensibility in mind. -- [sysmgr] a POSIX sh service supervisor for Linux systems similar to Runit. +- [sysmgr] a simplistic service supervisor inspired from runit. - [shinit] a POSIX sh init daemon with support for acting upon signals. - [sxss] Simple X ScreenSaver written in C99. - [mu-wizard] Email configuration wizard for setting up mu4e on Emacs. @@ -15,7 +15,7 @@ git repository, some of them are on [GitHub]. [Carbs Linux]: https://carbslinux.org [Carbs Packaging Tools]: https://git.carbslinux.org/cpt -[sysmgr]: https://git.ckyln.com/sysmgr +[sysmgr]: /sysmgr [shinit]: https://git.ckyln.com/shinit [sxss]: https://git.ckyln.com/sxss [mu-wizard]: https://github.com/cemkeylan/mu-wizard diff --git a/docs/sysmgr/index.html b/docs/sysmgr/index.html @@ -0,0 +1,110 @@ +<!DOCTYPE HTML> +<html lan=en> + <head> + <title>SYSMGR | Cem's Website</title> + <meta charset="utf-8"> + <meta name="Description" content="Cem Keylan's Website"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <style> + html {font-family:monospace;font-size:16px;color:#282a36;} + body { + width: 90%; + max-width: 1050px; + margin-left: auto; + margin-right: auto; + margin-top: 20px; + overflow: none; + overflow-y: scroll; + padding-right: 10px; + padding-left: 10px; + } + a{text-decoration:none;font-weight:bold;color:#282a36;} + a:hover{text-decoration:underline;} + @media (prefers-color-scheme: dark) { + html {color: white;background:#282a36;} + a{color:white;} + } + </style> + <link rel="stylesheet" href="/static/syntax.css"> + <script src="/static/highlight.pack.js"></script> + <script>hljs.initHighlightingOnLoad();</script> + </head> + <body> + <div class="header"> + <nav> + <a href='/'>index</a> | + <a href="/software.html">software</a> | + <a href="/blog.html">blog</a> | + <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | + </nav> + </div> + <hr> + <p> +<h1>SYSMGR</h1> + +<p>sysmgr is a service manager that aims to do as little as possible for service +supervision. It can be viewed as a simplified version of <a href="http://smarden.org/runit">runit</a>. It only cares +about making sure certain processes are alive unless explicitly stopped. Unlike +runit, it doesn&rsquo;t care about logging, or stopping daemons with special commands, +as those can easily be handled by service scripts themselves. It doesn&rsquo;t have +supervise directories with FIFOs inside. It <em>ONLY</em> cares about processes and +nothing else.</p> + +<h2>Interacting with sysmgr</h2> + +<p>While sysmgr can be interacted entirely with POSIX base tools, sysmgr provides +a tool named &lsquo;svctl&rsquo; for interacting with sysmgr. This tool can be used to check +the status and start/stop/restart services.</p> + +<p>When sysmgr picks up a service script inside the service directory, it +automatically starts the service unless stopped.</p> + +<h2>Details of implementation</h2> + +<p>The initial implementation of sysmgr was written in POSIX shell, and it used +POSIX compliant base-tools, however, in order to spawn as little processes as +possible, it did some Linuxisms which prevented portability. The current +implementation is written in C99, and it only uses functions from the POSIX-2008 +C Library, so it should work on all POSIX-compatible systems. Testing required.</p> + +<h2>Building and installing</h2> + +<p>Before building sysmgr, it is best to take a look at the config.h and config.mk +files, and modify them to fit your system. Afterwards you can do the following +(as root if necessary):</p> + +<pre><code>make +make install +</code></pre> + +<p>You can then install service scripts to your service directory and run sysmgr.</p> + +<h2>Service scripts</h2> + +<p>Service scripts can be any executable ranging from shell scripts to C binaries. +The only requirement is that they can be executable. An example script is as +follows:</p> + +<pre><code>#!/bin/sh -e +exec httpd -f -p 8080 -h /var/pub/www +</code></pre> + +<p>The exec call in the shell script makes sure that sysmgr is tracking the process +id of the httpd program rather than the shell script. It isn&rsquo;t necessary, but it +is the best practice to do so.</p> + +<p>On certain occasions a service can depend on other services to be able to start. +That&rsquo;s why a sysmgr-depends tool is supplied, in order to make sure a service +can wait until another service is up.</p> + +<pre><code>#!/bin/sh -e +sysmgr-depends dbus +exec NetworkManager -n +</code></pre> + </p> + <a href="/sysmgr/index.txt">This page in plain-text</a> + <hr> + <p class=footer>Copyright © 2019-2020 Cem Keylan</p> + </body> +</html> diff --git a/docs/sysmgr/index.txt b/docs/sysmgr/index.txt @@ -0,0 +1,72 @@ +SYSMGR +================================================================================ + +sysmgr is a service manager that aims to do as little as possible for service +supervision. It can be viewed as a simplified version of [runit]. It only cares +about making sure certain processes are alive unless explicitly stopped. Unlike +runit, it doesn't care about logging, or stopping daemons with special commands, +as those can easily be handled by service scripts themselves. It doesn't have +supervise directories with FIFOs inside. It _ONLY_ cares about processes and +nothing else. + +[runit]: http://smarden.org/runit + + +Interacting with sysmgr +-------------------------------------------------------------------------------- + +While sysmgr can be interacted entirely with POSIX base tools, sysmgr provides +a tool named 'svctl' for interacting with sysmgr. This tool can be used to check +the status and start/stop/restart services. + +When sysmgr picks up a service script inside the service directory, it +automatically starts the service unless stopped. + + +Details of implementation +-------------------------------------------------------------------------------- + +The initial implementation of sysmgr was written in POSIX shell, and it used +POSIX compliant base-tools, however, in order to spawn as little processes as +possible, it did some Linuxisms which prevented portability. The current +implementation is written in C99, and it only uses functions from the POSIX-2008 +C Library, so it should work on all POSIX-compatible systems. Testing required. + + +Building and installing +-------------------------------------------------------------------------------- + +Before building sysmgr, it is best to take a look at the config.h and config.mk +files, and modify them to fit your system. Afterwards you can do the following +(as root if necessary): + + make + make install + + +You can then install service scripts to your service directory and run sysmgr. + + +Service scripts +-------------------------------------------------------------------------------- + +Service scripts can be any executable ranging from shell scripts to C binaries. +The only requirement is that they can be executable. An example script is as +follows: + + #!/bin/sh -e + exec httpd -f -p 8080 -h /var/pub/www + + +The exec call in the shell script makes sure that sysmgr is tracking the process +id of the httpd program rather than the shell script. It isn't necessary, but it +is the best practice to do so. + +On certain occasions a service can depend on other services to be able to start. +That's why a sysmgr-depends tool is supplied, in order to make sure a service +can wait until another service is up. + + #!/bin/sh -e + sysmgr-depends dbus + exec NetworkManager -n + diff --git a/src/rss.xml b/src/rss.xml @@ -9,7 +9,7 @@ <description>Personal blog/website on Linux/tech/nerdy stuff</description> <link>https://cemkeylan.com</link> <atom:link href="https://cemkeylan.com/rss.xml" rel="self" type="application/rss+xml" /> - <lastBuildDate>Sat Oct 10 2020 09:00</lastBuildDate> + <lastBuildDate>Sat Oct 10 2020 10:00</lastBuildDate> <item> <title>Reimplementing `sysmgr` in C</title> <pubDate>Fri, 02 Oct 2020</pubDate> diff --git a/src/software.md b/src/software.md @@ -7,7 +7,7 @@ git repository, some of them are on [GitHub]. - [Carbs Linux] a Linux distribution aimed for simplicity. - [Carbs Packaging Tools] a portable package management toolchain written with extensibility in mind. -- [sysmgr] a POSIX sh service supervisor for Linux systems similar to Runit. +- [sysmgr] a simplistic service supervisor inspired from runit. - [shinit] a POSIX sh init daemon with support for acting upon signals. - [sxss] Simple X ScreenSaver written in C99. - [mu-wizard] Email configuration wizard for setting up mu4e on Emacs. @@ -15,7 +15,7 @@ git repository, some of them are on [GitHub]. [Carbs Linux]: https://carbslinux.org [Carbs Packaging Tools]: https://git.carbslinux.org/cpt -[sysmgr]: https://git.ckyln.com/sysmgr +[sysmgr]: /sysmgr [shinit]: https://git.ckyln.com/shinit [sxss]: https://git.ckyln.com/sxss [mu-wizard]: https://github.com/cemkeylan/mu-wizard diff --git a/src/sysmgr/index.md b/src/sysmgr/index.md @@ -0,0 +1,72 @@ +SYSMGR +================================================================================ + +sysmgr is a service manager that aims to do as little as possible for service +supervision. It can be viewed as a simplified version of [runit]. It only cares +about making sure certain processes are alive unless explicitly stopped. Unlike +runit, it doesn't care about logging, or stopping daemons with special commands, +as those can easily be handled by service scripts themselves. It doesn't have +supervise directories with FIFOs inside. It _ONLY_ cares about processes and +nothing else. + +[runit]: http://smarden.org/runit + + +Interacting with sysmgr +-------------------------------------------------------------------------------- + +While sysmgr can be interacted entirely with POSIX base tools, sysmgr provides +a tool named 'svctl' for interacting with sysmgr. This tool can be used to check +the status and start/stop/restart services. + +When sysmgr picks up a service script inside the service directory, it +automatically starts the service unless stopped. + + +Details of implementation +-------------------------------------------------------------------------------- + +The initial implementation of sysmgr was written in POSIX shell, and it used +POSIX compliant base-tools, however, in order to spawn as little processes as +possible, it did some Linuxisms which prevented portability. The current +implementation is written in C99, and it only uses functions from the POSIX-2008 +C Library, so it should work on all POSIX-compatible systems. Testing required. + + +Building and installing +-------------------------------------------------------------------------------- + +Before building sysmgr, it is best to take a look at the config.h and config.mk +files, and modify them to fit your system. Afterwards you can do the following +(as root if necessary): + + make + make install + + +You can then install service scripts to your service directory and run sysmgr. + + +Service scripts +-------------------------------------------------------------------------------- + +Service scripts can be any executable ranging from shell scripts to C binaries. +The only requirement is that they can be executable. An example script is as +follows: + + #!/bin/sh -e + exec httpd -f -p 8080 -h /var/pub/www + + +The exec call in the shell script makes sure that sysmgr is tracking the process +id of the httpd program rather than the shell script. It isn't necessary, but it +is the best practice to do so. + +On certain occasions a service can depend on other services to be able to start. +That's why a sysmgr-depends tool is supplied, in order to make sure a service +can wait until another service is up. + + #!/bin/sh -e + sysmgr-depends dbus + exec NetworkManager -n + diff --git a/template.html b/template.html @@ -36,6 +36,7 @@ <a href="/software.html">software</a> | <a href="/blog.html">blog</a> | <a href="/contact.html">contact</a> | + <a href="/sysmgr">sysmgr</a> | </nav> </div> <hr>