commit 744b4a8851c6e6d874e9f886a74aee47c755d655
parent 88a3d62e04dc59ad5762f50ec8ea84e450540048
Author: Cem Keylan <cem@ckyln.com>
Date: Tue, 11 Feb 2020 16:19:50 +0300
add manpage
Diffstat:
M | Makefile | | | 25 | +++++++++++++++++-------- |
A | minit.8 | | | 32 | ++++++++++++++++++++++++++++++++ |
2 files changed, 49 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,22 +1,27 @@
-VERSION = 0.1.0
+VERSION = 0.1.0
-PREFIX = /usr/local
-BINDIR = ${PREFIX}/bin
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/share/man
+BINDIR = ${PREFIX}/bin
-CFLAGS = -Wextra -Wall -Os
-LDFLAGS = -s -static
-CC = cc
+CFLAGS = -Wextra -Wall -Os
+LDFLAGS = -s -static
+CC = cc
+groff = groff -m man
all: minit
minit: config.h
${CC} ${LDFLAGS} ${CFLAGS} -o $@ minit.c
+minit.8.html:
+ ${groff} -Thtml ./minit.8 > minit.8.html
+
config.h:
cp config.def.h config.h
clean:
- rm -f minit minit-${VERSION}.tar.gz
+ rm -f minit minit-${VERSION}.tar.gz minit.8.html
dist:
mkdir minit-${VERSION}
@@ -26,10 +31,14 @@ dist:
gzip minit-${VERSION}.tar
rm -rf minit-${VERSION}
+htmldoc: minit.8.html
+
install: all
install -Dm755 minit ${DESTDIR}${BINDIR}/minit
+ install -Dm644 minit.8 ${DESTDIR}${MANPREFIX}/man8/minit.8
uninstall:
rm -f ${DESTDIR}${BINDIR}/minit
+ rm -f ${DESTDIR}${MANPREFIX}/man8/minit.8
-.PHONY: all clean dist install uninstall
+.PHONY: all clean dist htmldoc install uninstall
diff --git a/minit.8 b/minit.8
@@ -0,0 +1,32 @@
+.
+.TH "MINIT" "8" "February 2020" "Cem Keylan" "Init System Manual"
+.
+.SH "NAME"
+\fBminit\fR \- mini init daemon
+.
+.SH "DESCRIPTION"
+minit is an init daemon with simple halting capabilities. It only runs as pid 1, and listens for signals upon being started.
+.
+.SH "SIGNAL HANDLING"
+minit will respond to the following signals:
+.
+.P
+USR1 \- Runs the compiled poweroff function
+.
+.P
+INT \- Runs the compiled reboot function
+.
+.P
+USR2 \- Requests poweroff from the kernel (Halts)
+.
+.P
+QUIT \- Requests reboot from the kernel (Halts)
+.
+.SH "AUTHORS"
+Cem Keylan \- <\fIcem@ckyln.com\fR>
+.
+.SH "BUGS"
+If you encounter any bugs, please report them\.
+.
+.SH "SEE ALSO"
+sinit(8), getty(8)