All Projects → cemkeylan → shinit

cemkeylan / shinit

Licence: MIT license
Basic Init Daemon in POSIX sh

Programming Languages

shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to shinit

Daemonizable Command
Daemonizable (endless running) commands for Symfony.
Stars: ✭ 189 (+1011.76%)
Mutual labels:  daemon
privacy-settings
Guide to privacy settings for most major softwares and services.
Stars: ✭ 97 (+470.59%)
Mutual labels:  signal
conceal-api
Conceal API - JavaScript Interface (RPC/API)
Stars: ✭ 18 (+5.88%)
Mutual labels:  daemon
Whapp Irc
whatsapp web <-> irc gateway
Stars: ✭ 208 (+1123.53%)
Mutual labels:  daemon
install
basic script for project installation
Stars: ✭ 17 (+0%)
Mutual labels:  init
OS-X-Yosemite-on-Unsupported-Macs
Install OS X Yosemite on Unsupported Macs
Stars: ✭ 23 (+35.29%)
Mutual labels:  reboot
Fusioninventory Agent
FusionInventory Agent
Stars: ✭ 177 (+941.18%)
Mutual labels:  daemon
go-init
A minimal init system for containers with pre/post hooks
Stars: ✭ 36 (+111.76%)
Mutual labels:  init
distrobox
Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Stars: ✭ 4,371 (+25611.76%)
Mutual labels:  posix-sh
fsig
Send signals to a subprocess when files change
Stars: ✭ 16 (-5.88%)
Mutual labels:  signal
Daemonize
Library for writing system daemons
Stars: ✭ 210 (+1135.29%)
Mutual labels:  daemon
Ebusd
daemon for communication with eBUS heating systems
Stars: ✭ 237 (+1294.12%)
Mutual labels:  daemon
ergo
A modern IRC server (daemon/ircd) written in Go.
Stars: ✭ 1,916 (+11170.59%)
Mutual labels:  daemon
Ktrl
A Supercharged Keyboard Programming Daemon ⌨️
Stars: ✭ 190 (+1017.65%)
Mutual labels:  daemon
watchdogd
Advanced system & process supervisor for Linux
Stars: ✭ 146 (+758.82%)
Mutual labels:  daemon
Node Windows
Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Stars: ✭ 2,311 (+13494.12%)
Mutual labels:  daemon
rubircd
💬 An IRC server written in Ruby
Stars: ✭ 23 (+35.29%)
Mutual labels:  daemon
tpm2-abrmd
TPM2 Access Broker & Resource Management Daemon implementing the TCG spec.
Stars: ✭ 97 (+470.59%)
Mutual labels:  daemon
minimalist
Observable Property and Signal for building data-driven UI without Rx
Stars: ✭ 88 (+417.65%)
Mutual labels:  signal
css-reset-and-normalize
A combination of css reset and normalize (available in CSS, SCSS, Stylus and LESS).
Stars: ✭ 20 (+17.65%)
Mutual labels:  reboot

shinit

Basic init daemon in POSIX sh with only 5 lines of code. It supports acting upon signals.

On USR1 signal it will poweroff, and on INT signal it will reboot.

Installing

Before installing, edit the second command to use your boot/poweroff script. If you are using Carbs Linux or KISS, you don't need to change it.

You can then install with make.

make install

Note on halting the system

shinit does NOT deal with system halting. You will need an extra utility for that given purpose. ubase halt deals with this. You can also use compile this really simple C program that tells to kernel to shutdown or reboot.

#include <sys/reboot.h>

int
main(int argc, char *argv[])
{
    switch ((int) argv[argc < 2 ? 0 : 1][0]) {
    case 'p': reboot(RB_POWER_OFF); break;
    case 'r': reboot(RB_AUTOBOOT);  break;
    default: return 1;
    }
    return 0;
}

You can compile the following program to something named halt or whatever you like. If you call halt p it will power off, if you call halt r it will reboot. Just note that this needs to be at the end of your init script, because this command will shut your computer down straight away. You can do the following check at the end of your init script:

case "$1" in
    poweroff) halt p ;;
    reboot)   halt r ;;
esac
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].