Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

cemkeylan/minit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minit - mini init

A small init daemon forked from sinit with basic halting capabilities.

It is considered complete and stable, and will not be worked upon.

Building and installing

minit can be configured from config.h before compile time. After editing you can simply build and install with

make
make install

Usage Note

This halting capability adds 2 signals to the init daemon, SIGUSR2 and SIGQUIT. Keep in mind that you do not want to send these signals standalone, as they will power your computer off, they will not run through your init scripts or anything. You must send these signals from the init scripts so your computer shuts down (or reboots) after you deal with the delicate parts of your shutdown process.

Controlling minit

You can add some basic poweroff/reboot programs so you don't have to remember which signal to send with your kill command.

A basic poweroff would be

#!/bin/sh
/bin/kill -s USR1 1

A basic reboot would be

#!/bin/sh
/bin/kill -s INT 1

On your init script, you can add something like

case "$1" in
    reboot) /bin/kill -s QUIT 1 ;;
    poweroff) /bin/kill -s USR2 1 ;;
esac