commit bd089dd5b18cd472c10f554a46c163e3b51a58a2
Author: sin <[email protected]>
Date:   Tue Apr 22 12:42:59 2014 +0100

    Add sinit.8 manpage

diff --git a/Makefile b/Makefile
index 4d8d11c..1b7867f 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ config.h:
 dist: clean
        @echo creating dist tarball
        @mkdir -p sinit-$(VERSION)
-       @cp LICENSE Makefile README config.def.h config.mk sinit.c \
+       @cp LICENSE Makefile README config.def.h config.mk sinit.8 sinit.c \
                sinit-$(VERSION)
        @tar -cf sinit-$(VERSION).tar sinit-$(VERSION)
        @gzip sinit-$(VERSION).tar
@@ -45,11 +45,17 @@ install: all
        @echo installing executable to $(DESTDIR)$(PREFIX)/bin
        @mkdir -p $(DESTDIR)$(PREFIX)/bin
        @cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
-       @cd $(DESTDIR)$(PREFIX)/bin && chmod 755 $(BIN)
+       @chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
+       @echo installing manual page to $(DESTDIR)$(MANPREFIX)/man8
+       @mkdir -p $(DESTDIR)$(MANPREFIX)/man8
+       @sed "s/VERSION/$(VERSION)/g" < sinit.8 > 
$(DESTDIR)$(MANPREFIX)/man8/sinit.8
+       @chmod 644 $(DESTDIR)$(MANPREFIX)/man8/sinit.8
 
 uninstall:
        @echo removing executable from $(DESTDIR)$(PREFIX)/bin
        @cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
+       @echo removing manual page from $(DESTDIR)$(MANPREFIX)/man8
+       @rm -f $(DESTDIR)$(MANPREFIX)/man8/sinit.8
 
 clean:
        @echo cleaning
diff --git a/config.mk b/config.mk
index bc1b0dc..b766d3b 100644
--- a/config.mk
+++ b/config.mk
@@ -3,7 +3,7 @@ VERSION = 0.9
 
 # paths
 PREFIX = /usr/local
-MANPREFIX = $(PREFIX)/man
+MANPREFIX = $(PREFIX)/share/man
 
 CC = cc
 LD = $(CC)
diff --git a/sinit.8 b/sinit.8
new file mode 100644
index 0000000..dd01387
--- /dev/null
+++ b/sinit.8
@@ -0,0 +1,24 @@
+.TH SINIT 8 sinit-VERSION
+.SH NAME
+sinit \- The suckless init
+.SH DESCRIPTION
+sinit is a simple init.  It is configured by modifying `config.h'
+and recompiling the code.
+.SS Signal handling
+sinit will respond to the following set of signals:
+.IP USR1
+Default action is to initiate the shutdown sequence by
+executing `/bin/rc.shutdown poweroff'.
+.IP INT
+Default action is to initiate the reboot sequence by
+executing `/bin/rc.shutdown reboot'.
+.IP CHLD
+Reap children.
+.SS General considerations
+Calling the aforementioned scripts directly might or might not
+work in your case.  For example if any process in your session
+has stale filesystem references then it is likely your init scripts
+will fail to unmount the filesystem cleanly.  It is recommended to
+signal sinit via a wrapper script.
+.SH SEE ALSO
+killall5(8), getty(8)


Reply via email to