diff --git a/Makefile b/Makefile index 9f858caa..2ebd78fb 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,8 @@ install-exec: all printf " INSTALL $(DESTDIR)$(sbindir)/$$file\n"; \ $(STRIPINST) $$file $(DESTDIR)$(sbindir)/$$file; \ done + printf " INSTALL $(DESTDIR)$(sbindir)/initctl\n" + @ln -sf finit $(DESTDIR)$(sbindir)/initctl $(MAKE) -C libite install-exec $(MAKE) -C plugins install @@ -109,6 +111,7 @@ uninstall-exec: printf " REMOVE $(DESTDIR)$(sbindir)/$$file\n"; \ rm $(DESTDIR)$(sbindir)/$$file 2>/dev/null; \ done + -@rm $(DESTDIR)$(sbindir)/initctl -@rmdir $(DESTDIR)$(sbindir) 2>/dev/null -@rmdir $(DESTDIR)$(FINIT_RCSD) 2>/dev/null $(MAKE) -C libite uninstall diff --git a/README.md b/README.md index 3120a84e..41505887 100644 --- a/README.md +++ b/README.md @@ -519,7 +519,40 @@ Rebooting & Halting Finit handles `SIGUSR1` and `SIGUSR2` for reboot and halt, and listens to `/dev/initctl` so system reboot and halt commands should also work. This latter functionality is implemented in the optional `initctl.so` -plugin. +plugin and can be accessed with the `initctl` command line tool (which +is symlinked to `finit`). + + ~ # initctl + Usage: initctl [OPTIONS] [ | ] + + Options: + -d, --debug Toggle Finit debug + -v, --verbose Verbose output + -h, --help This help text + + Commands: + debug Toggle Finit debug + q | reload Reload *.conf in /etc/finit.d/ + runlevel <1-6> Set new runlevel + status Show status of services + start Start stopped service + stop Stop running service + restart Restart (stop/start) running service + reload Reload (SIGHUP) running service + version Show Finit version + + ~ # initctl status + # Status PID Runlevels Service Description + ==================================================================================== + 1 running 480 [S12345] /sbin/watchdog System watchdog daemon + 2 running 481 [S12345] /sbin/syslogd System log daemon + 3 running 519 [S12345] /sbin/klogd Kernel log daemon + 4:1 stopped 0 [345] /sbin/dropbear SSH daemon + 4:2 stopped 0 [345] /sbin/dropbear SSH daemon + 5:1 waiting 0 [2345] internal UNIX rdate service + 5:2 waiting 0 [2345] internal UNIX rdate service + 6:1 waiting 0 [2345] /sbin/telnetd Telnet service + 6:2 waiting 0 [2345] /sbin/telnetd Telnet service Building