diff options
| author | Klaatu <[email protected]> | 2015-05-17 15:33:21 +1200 |
|---|---|---|
| committer | Klaatu <[email protected]> | 2015-05-17 15:33:21 +1200 |
| commit | b0de699679e8f1e39af847ed172d1ba605b4370c (patch) | |
| tree | 01dac00471d61f727394e508c613b29cff0ceae5 /man | |
bulk upload of source
Diffstat (limited to 'man')
| -rw-r--r-- | man/bootlog.8 | 89 | ||||
| -rw-r--r-- | man/inittab.8 | 98 | ||||
| -rw-r--r-- | man/ninit.8 | 178 | ||||
| -rw-r--r-- | man/nkillall.8 | 139 | ||||
| -rw-r--r-- | man/nsvc.8 | 240 | ||||
| -rw-r--r-- | man/pidfile.8 | 75 | ||||
| -rw-r--r-- | man/pututmpid.8 | 73 | ||||
| -rw-r--r-- | man/reboot.8 | 59 | ||||
| -rw-r--r-- | man/reload.8 | 120 | ||||
| -rw-r--r-- | man/runlevel.8 | 108 | ||||
| -rw-r--r-- | man/scan.8 | 99 | ||||
| -rw-r--r-- | man/service.8 | 46 | ||||
| -rw-r--r-- | man/shutdown.8 | 89 | ||||
| -rw-r--r-- | man/sysvinit.8 | 155 |
14 files changed, 1568 insertions, 0 deletions
diff --git a/man/bootlog.8 b/man/bootlog.8 new file mode 100644 index 0000000..f963e29 --- /dev/null +++ b/man/bootlog.8 @@ -0,0 +1,89 @@ +.TH bootlog 8 "Dec 28, 2009" +.SH NAME +bootlog \- write stdout/stderr of a program to file +.SH SYNOPSIS +.B bootlog +[-12ctar] logsize logfile program [arguments] + +.SH DESCRIPTION +.B bootlog +is used to start a program and write stdout/stderr to a disk file. +This works also before mouning any file systems. + +.B bottlog +is designed to log the output of scripts/services at boot time, +before mounting any file system. This is typical for +system init. + +.B bootlog +expects that when the program exits, the +.I logfile +is writable! + +.SH OPTIONS +.TP +\-1 +log only stdout +.TP +\-2 +log only stderr; default is to log stdout and stderr +.TP +\-c +create logfile +.TP +\-t +truncate logfile +.TP +\-a +append to logfile +.TP +\-r +replace old +.I logfile +with +.I logfile~ +.TP +.I logsize +maximal size of output to be logged +.TP +.I logfile +disk file name +.TP +.I program +the name of the +.I program +to start +.TP +.I arguments +additional arguments for +.I program + +.SH WARNING +Use the option \-c to force creating of the +.I logfile. + +Actually the options \-c, \-a, \-t add O_CREAT, O_APPEND, O_TRUNC +flags to open(2) for +.I logfile + +.SH EXAMPLE +bootlog -ctr 120000 /tmp/.sysinit.log /etc/rc.d/rc.sysinit + +You will have the files +.I /tmp/.sysinit.log +and +.I /tmp/.sysinit.log~ + +.SH ENVIRON +.B bootlog +uses the variable PATH to start +.I program +.br +If PATH is undefined it uses PATH=/bin:/usr/bin + +.SH AUTHOR +.B bootlog +is part of ninit package written by Nikola Vladov + +.SH "SEE ALSO" +ninit(8), open(2) diff --git a/man/inittab.8 b/man/inittab.8 new file mode 100644 index 0000000..bcede1c --- /dev/null +++ b/man/inittab.8 @@ -0,0 +1,98 @@ +.TH ninit\-inittab 8 "Dec 28, 2009" +.SH NAME +ninit\-inittab \- convert /etc/inittab to service directory +.SH SYNOPSIS +.B ninit\-inittab +.I inittab_file +.I home_directory +.I output_script + +.SH DESCRIPTION +.B ninit\-inittab +creates a script using +.I /etc/inittab +file. +This script can be used to create a service directory easy. + +.SH OPTIONS +.TP +.I inittab_file +input source file +.TP +.I home_directory +home directory for +.B ninit +.TP +.I output_script +name of the output script + +.SH USAGE +.B Case A. +If you don't have services in +.I /etc/ninit +you can start: + +.PP +.RS +cd /tmp +.br +ninit\-inittab +/etc/inittab /etc/ninit services.sh +.br +less services.sh +.br +/tmp/services.sh +.RE +.PP + +Then check what the script has done in +.I /etc/ninit + +.B Case B. +If you already have a +.I /etc/ninit +directory with services, +and don't want to make any changes there you can type: + +.PP +.RS +cd /tmp; cp /etc/inittab /tmp; vi inittab +.br +ninit\-inittab +/tmp/inittab /tmp/srv services.sh +.br +less services.sh +.br +/tmp/services.sh +.RE +.PP + +Then check what the script has done in +.I /tmp/srv. +If you find something +interesting there you can copy it to +.I /etc/ninit + +.SH AUTHOR +.B ninit\-inittab +was written by Nikola Vladov. + +The aim was to easily convert a host running +SysVinit to ninit. In my opinion creating services is very easy. +Maybe you have to look +in some already prepared service directory first. + +Ask google for "ninit archlinux" and you will find +an excellent git repository with services for +.I /etc/ninit + + +.SH FILES +.I /etc/inittab +.br +.I /etc/ninit/ + +.SH "SEE ALSO" +ninit(8), ninit\-runlevel(8), ninit\-sysvinit(8), pututmpid(8) +.br +init(8), inittab(5), runlevel(8) diff --git a/man/ninit.8 b/man/ninit.8 new file mode 100644 index 0000000..e6a9e8a --- /dev/null +++ b/man/ninit.8 @@ -0,0 +1,178 @@ +.TH ninit 8 "Jan 15, 2010" +.SH NAME +ninit \- a UNIX process no 1 +.SH SYNOPSIS +.B ninit +[\-Mnumber] [\-Hhome] [\-Ssystem] [service] ... + +.SH DESCRIPTION +.B ninit +is a possible first process the kernel starts. It can +start/stop/monitor all services the OS needs. + +To use ninit as system init, first read available documentation in +.I http://riemann.fmi.uni-sofia.bg/ninit/ +and then add the parameter +\fIinit=/sbin/ninit\fR +to your kernel command line. + +If you want to use ninit +only to start/monitor services and continue to use +the default init(8) then put in +.I /etc/inittab +.br +.B NI:12345:respawn:/sbin/ninit +.br +In this case you should remove the service +.B sysvinit +and don't use the programs: +ninit\-runlevel(8), ninit\-sysvinit(8). +Similarly it is possible to start ninit using +.B /etc/init.d/ninit +script. + + +.SH USAGE +.B ninit +will by default do nothing except start the ninit +service defined in +.I /etc/ninit/default +which usually contains a file named +.I depends +specifying which services are to be started at bootup. + +To control ninit use the companion program +.B nsvc. +Do not make it SUID unless you know what are you doing! + +The program +.B ninit\-sysvinit +listens to the fifo +.I /dev/initctl +and allows SysVinit programs +shutdown, halt, reboot, telinit to work properly. +If there is a service +.I /etc/ninit/sysvinit +it starts +.B ninit\-sysvinit. + + +To stop the box running +.B ninit +use the programs +.B ninit\-shutdown +or +.B nsvc. + +.SH "NONROOT USAGE" +Any nonroot user can use +.B /sbin/ninit +to start/monitor own services. First make private +ninit directory with +.br +.B /etc/ninit/bin/ninit\-conf ~/.ninit +.br +and put somewhere in shell profile: +.B export NINIT_HOME=~/.ninit + +Then create some services in $NINIT_HOME and start +.br +.B /sbin/ninit -H$NINIT_HOME + +.SH OPTIONS +.TP +.B \-Mnumber +Tells ninit to use +.B number +bytes for memory buffer. One service uses approximately 30 bytes. +.TP +.B \-Hhome +Changes the ninit home. Default: +.I /etc/ninit +.TP +.B \-Ssystem +Changes the ninit system directory. Default: +.I sys + +.SH SIGNALS +On receiving of some signals +.B ninit +starts appropiate service. + +.TP +.B SIGINT +Normally the kernel sends this signal to ninit when CTRL-ALT-DEL is +pressed. It activates the \fIctrlaltdel\fP action and ninit +starts the service +.I ctrlaltdel +.TP +.B SIGWINCH +The kernel sends this signal when the \fIKeyboardSignal\fP key is hit. +It activates the \fIkbrequest\fP action +and ninit starts the service +.I kbreq +.TP +.B SIGHUP +Has the same effect as telinit q. +Ninit restarts the service +.I levelQ +.TP +.B SIGUSR1 +On receipt of this signal, ninit closes and re-opens its control fifo, +.I /dev/initctl. +Useful for bootscripts when /dev is remounted. +.TP +.B SIGPWR +Ninit starts the service +.I powerS. +This service starts the program +.B ninit-sysvinit +with one argument: powerS. + +.SH SERVICES +Each service has own subdirectory in +.I /etc/ninit/ +three. There are lots of config files for a service. +The main daemon +.B ninit +check only the files +.I depends, sync, respawn, end +to start a service. +Check olso the link: +.br +.I http://riemann.fmi.uni-sofia.bg/ninit/files.html + +If the servive name start with '#' or '\-' it is blacklisted. +You can now blacklist services temporarily by passing it on +the kernel command line. The first time they are to be started +will then be skipped. Use this, for example, to not start the dhcp +client when your notebook is not plugged in a network. +Look in ninitfeatures.h if ninit is compiled to use this option. + +.SH FILES +.I NINIT_HOME/in +.br +.I NINIT_HOME/out +.br +.I NINIT_HOME/sys/ +.br +.I /dev/initctl + + +.SH AUTHOR +ninit was written by Nikola Vladov and can be downloaded from +.I http://riemann.fmi.uni-sofia.bg/ninit/ + +.SH SEE ALSO +nsvc(8), ninit-service(8), ninit-reload(8) +.br +ninit-shutdown(8), ninit-reboot(8), nkillall(8) +.br +ninit-sysvinit(8), ninit-runlevel(8) +.br +minit(8), +.I http://www.fefe.de/minit/ +.br +init(8), shutdown(8), halt(8), reboot(8) + +Part of this manpage was written by Erich Schubert. diff --git a/man/nkillall.8 b/man/nkillall.8 new file mode 100644 index 0000000..6564834 --- /dev/null +++ b/man/nkillall.8 @@ -0,0 +1,139 @@ +.TH nkillall 8 "Dec 28, 2009" +.SH NAME +nkillall \- send signals to all processes; write messages to users +.SH SYNOPSIS +.B nkillall +-[vq] [-s secs] [-M|W mesg] [-signum] [-E prog [arg[s]] +.SH DESCRIPTION +.B nkillall +sends signals +to all processes skipping it's own PID. +It is a simple program that does not use \fI/proc\fR FS. +It uses kill(2) and execve(2) syscalls. It is designed as +a replacement of the SysVinit killall5(8) command. + +.SH USAGE +It is not allowed to use +.B \-h +(signal SIGHUP) as first option! If you really want this then start: +.B nkillall +\-s0 \-hup ... + +.TP +.B \-v +verbose mode; \-vv means more verbose +.TP +.B \-q +quiet mode; ignores SIGINT signal; Ctrl-C does't work! +.TP +.B \-s +\fIsecs\fR +.br +sleep \fIsecs\fR +.TP +.B \-M +\fImesg\fR +.br +write \fImesg\fR to stdout. The message can include escape +symbols: +\\NNN, \\a, \\b, \\e, \\c, \\f, \\n, \\r, \\t, \\v, \\\\ +like in C language. Last message can be written again with +\-M% or \-W%. Example: + +.B nkillall +\-M'\\n\\aPlease logout! The system is going down...' \\ + \-W% \-s2 -W% \-s4 \-W% \-s12 \\ + \-M'\\tSending TERM signal' \-term ... +.TP +.B \-W +\fImesg\fR +.br +write \fImesg\fR to all logged users. The syntax is the same as \-M. +.B nkillall +determines logged users by looking at +.I /var/run/utmp. + +.br +In my opinion +.I /var/run/utmp +is unreliable! +Other programs like who(1), wall(1), login(1) also use this file. +If you feel that yours is insecure, better don't use the \-W option. + +.TP +.B \-signum +send all processes the singal \fIsignum\fR. +Some important signals can be encodded. For example SIGTERM can be typed with +\-15 or \-term. +Only the first letter is important! +The command +.B kill \-l +lists the signal numbers. +.TP +.B \-E +.I /path/to/program [arg[s]] +.br +execve(2) the program with some arguments. +This option must be last! The program will have the same PID as +.B nkillall. + +.SH NOTE +The options are applied immediately. Their position is important. +The next two examples work differently: + +nkillall \-q -s2 \-M'sending signal SIGTERM' \-15 ... +.br +nkillall \-s2 \-M'sending signal SIGTERM' \-15 \-q ... + +Use the options \-v[v] \-q after +.B nkillall +immediately. + +.SH WARNING +.B nkillall +also kills the script in which it is included. +Use it in scripts like: + +#!/bin/sh +.br +before commands +.br +exec nkillall [options] \-E/path/to/prog prog_opt(s) + +An example of wrong usage is the following: + +#!/bin/sh +.br +before commands +.br +nkillall ... +.br +after commands + +.SH EXAMPLES +.B nkillall +\-M'Sending all processes SIGTERM ...' \-s2 \-15 \\ +.br + \-M'Sending all processes SIGKILL ...' \-s6 \-9 \\ +.br + \-s1 \-E /path/to/program arg1 arg2 ... + +.B nkillall +\-v \-s1 \-15 \-cont \-s6 \-kill \-s1 \-E/path/to/prog arg(s) ... + +.B nkillall +\-vv \-pause \-s59 \-continue \-M'Hello world!' + +.SH FILES +.I /var/run/utmp + +.SH AUTHOR +.B nkillall +is included in ninit package and can be downloaded from +.br +.I http://riemann.frmi.uni-sofia.bg/ninit/ + +.SH "SEE ALSO" +ninit(8), kill(1), kill(2), execve(2), utmp(5) +.br +init(8), killall5(8) diff --git a/man/nsvc.8 b/man/nsvc.8 new file mode 100644 index 0000000..3ac0900 --- /dev/null +++ b/man/nsvc.8 @@ -0,0 +1,240 @@ +.TH nsvc 8 "Jan 19, 2010" +.SH NAME +nsvc \- control ninit +.SH SYNOPSIS +.B nsvc +[ -Sservice ] +[ +.B \-[uodgpchaitkorRDCLHVWZE] +] +.I service +[\fI...\fR] +.br +.B nsvc -Ppid +.I service +. +.SH DESCRIPTION +.B nsvc +is the management interface to ninit. +.I service +is the service directory name relative to /etc/ninit. +You can also include /etc/ninit/ in the service name. +.PP +Each service directory contains control files. +They are described on +.I http://riemann.fmi.uni-sofia.bg/ninit/ + +.PP +It is possible to make nsvc SUID. +.PP +.RS +.B chown root.root /bin/nsvc +.br +.B chmod 4711 /bin/nsvc +.RE +.PP +Then nsvc opens the pipes +.IR /etc/ninit/in , +.I /etc/ninit/out +and switches to real UID. +If UID is nonzero only limited set of operation are allowed. +. +.SH OPTIONS +If no options are given, +.B nsvc +will just print a diagnostic message to stdout, saying if the +service is up, down or finished, which PID it has if it is up, and for +how long it has been in this state. + +Only the service name +.B ALL +means all services. + +.TP +.B \-Sservice +Skip service. Apply this option immediately after +.B nsvc. +Don't insert space between S and service. +Examples: +.br +.B nsvc +\-Sngetty \-Ssshd \-Slogger \-d ALL +.br +.B nsvc +\-Sngetty \-W3 ALL || +.B nsvc +\-Sngetty \-k ALL + +.TP +.B \-u \-uNumber +Up. +If the service is not running, start it. +If the service stops, restart it. If +.B Number +is nonzero and the service is down start it after +.B Number +seconds. +.TP +.B \-o \-oNumber +Once. +If the service is down, start it. +If the service stops, do not restart it. +If +.B Number +is nonzero and the service is down, start it after +.B Number +seconds; if it is up, restart it later. +.TP +.B \-d +Down. +If the service is running, send it a TERM signal and then a CONT signal. +After it stops, do not restart it. +.TP +.B \-r +Stop respawn. +Set respawn flag to OFF. This does not start/stop the service. +.TP +.B \-R +Start respawn. +Set respawn flag to ON. This does not start/stop the service. +.TP +.B \-p +Pause. +Send the service a STOP signal. +.TP +.B \-c +Continue. +Send the service a CONT signal. +.TP +.B \-h +Hangup. +Send the service a HUP signal. +.TP +.B \-a +Alarm. +Send the service an ALRM signal. +.TP +.B \-i +Interrupt. +Send the service an INT signal. +.TP +.B \-t +Terminate. +Send the service a TERM signal. +.TP +.B \-k +Terminate. +Send the service a KILL signal. +.TP +.B \-g +Get. Output just the PID. +.TP +.B \-Ppid \fIservice\fR +Set pid of service. +.TP +.B \-D \fIservice\fR +Print dependencies. +This will print all the names of all the services that were started +because this services depended on them. Example: +.br +.B nsvc -D default +.TP +.B \-D +Print ninit memory usage statistics. +.TP +.B \-H +Print history. +This will print the names of some recently spawned processes. +This is useful if you see a process looping (initialization fails and +ninit is restarting it all the time). +.TP +.B \-L +Print all services loaded in memory. +.TP +.B \-V +Print version +.TP +.B \-Wnumber +Wait at most +.B number +seconds service(s) to finish. Example: +.br +.B nsvc \-d qmail +.br +.B nsvc \-W180 qmail || nsvc -k qmail +.TP +.B \-Cnumber \-C+number +Tell ninit that the service is in CRON mode. +If +.B number +is zero it disables CRON mode. Let now=`date +%s`. +If +.B number < now +then ninit starts the service immediately, +otherwise ninit will start it latter. +The flag +.B \-C+number +(if the +.B number +is positive) +is equaivalent to the following: +.br +.B t=`expr now + number` +.br +.B nsvc -C$t ... + +To stop foo, +which is in CRON mode do: +.br +.B nsvc -C0 foo +.br +.B nsvc -d foo +.br +.\" To see the next CRON timestamp of foo type: +.\" .B nsvc foo +.TP +.B \-Z \-Znumber +Zero (free) a service. This is done with the ninit-reload program. +Example: +.br +.B nsvc -Z30 foo +.br +This removes foo (if such a service exists) +and prepares ninit to accept 30 new services approximately. +.TP +.B \-E \-Enumber +Update ninit environ. This is done by ninit-reload program. +Example: +.br +.B nsvc \-E36 ABC=12 UVW +.br +This updates the variable +.B ABC +and removes +.B UVW. +It prepares ninit to accept 36 new services approximately. +See the environ with: +.br +.B tr '\\\\000' '\\\\012' < /proc/1/environ + +. +.SH "RETURN CODES" +Generally, +.B nsvc +returns zero if everything is OK or 1 on error (could not +open /etc/ninit/in or /etc/ninit/out or there is no process with the +given name). In diagnostic mode, it will exit 0 if the service is up, 2 +if it is down or 3 if it is finished. + +. +.SH "ENVIRON" +.B nsvc +uses the variables +.B NINIT_MEMORY +and +.B NINIT_HOME. + +.SH "SEE ALSO" +ninit(8), ninit-scan(8) +.br +ninit-shutdown(8), nkillall(8), svc(8), msvc(8) diff --git a/man/pidfile.8 b/man/pidfile.8 new file mode 100644 index 0000000..97efe18 --- /dev/null +++ b/man/pidfile.8 @@ -0,0 +1,75 @@ +.TH ninit\-pidfile 8 "Dec 28, 2009" +.SH NAME +ninit\-pidfile \- work around daemons that always fork +.SH SYNOPSIS +.B ninit\-pidfile +.I servicename +.I pidfile +[ +.I -H home +] +.I command +.I [parameters] + +.SH DESCRIPTION +.B ninit\-pidfile +is used to work around daemons that insist on forking into the background, +but that do write a correct pid file. + +.B ninit\-pidfile +forks the actual service, then waits for the pidfile to +be written. Once it can read the pid from the pidfile it will tell +ninit the real pid and quit. + +.SH OPTIONS +.TP +.I servicename +the name of the service +ninit\-pidfile is installed for +.TP +.I pidfile +the filename to read the pid from +.TP +.I command +the real command to start +.TP +.I parameters +additional parameters for the command +.TP +.B \-H \fIhome\fR +.br +the home of ninit. Default: /etc/ninit + +.SH USAGE +With +.B ninit +you can prepare a service and if it forks and writes +the PID in some file then type in the service directory: + + echo /path/to/deamon.pidfile > +.I pidfile + +For apache this looks like: + + cd /etc/ninit/apache +.br + echo /var/run/apache.pid > +.I pidfile + +Don't use hard or soft links here! +.br +Then +.B ninit +will start apache using +.B ninit\-pidfile + +.SH AUTHOR +.B pidfilehack +was written +by Felix von Leitner. + +This manpage was written by Erich Schubert <[email protected]> +for the Debian GNU/Linux operating system. + +.SH "SEE ALSO" +ninit(8), nsvc(8), pidfilehack(8) diff --git a/man/pututmpid.8 b/man/pututmpid.8 new file mode 100644 index 0000000..7bcac33 --- /dev/null +++ b/man/pututmpid.8 @@ -0,0 +1,73 @@ +.TH pututmpid 8 "Dec 28, 2009" +.SH NAME +pututmpid \- write utmp/wtmp records and exec command +.SH SYNOPSIS +.B putupmpid +.I [-w] +.I ut_id +.I command +.I [parameters] +.br +.B pututmpid +.I reboot +.br +.B pututmpid +.I halt + + +.SH DESCRIPTION +.B pututmpid +is used to write records in utmp/wtmp files for running +getty/agetty/fgetty. +pututmpid writes the record and then execve()s a command. +The commands +.B login +and +.B getty +use the records written from pututmpid. + +After reboot it is possible to set +.B pututmpid reboot +in init scripts. +This will update /var/run/utmp with BOOT_TIME record. This +must be done after /var/run/utmp is writable. The usage of +.B pututmpid halt +is similar. It sets wtmp record (in /var/log/wtmp file). + +.SH OPTIONS +usually pututmpid is symlinked as \fIrun\fR command of a service. +.TP +.B \-w +debug mode -- write more info in /var/log/wtmp +.TP +.B ut_id +string at most 4 bytes long. examples: tty1,tty2, vc1,vc2,vc3... +Use different names for each virtual console! +.TP +.B command +the real command to start +.TP +.B parameters +additional parameters for the command + +.SH EXAMPLE +A typical use of this command will look like this: +.TP +/etc/ninit/getty/2 +.TP +/etc/ninit/getty/2/params +tty2 +.br +/sbin/fgetty +.br +tty2 +.TP +/etc/ninit/getty/2/run +-> /sbin/pututmpid + +.SH "SEE ALSO" +ninit(8), ninit\-runlevel(8) +.br +getty(8), {n|f|a|min}getty(8), +.br +login(1), utmp(5), runlevel(8) diff --git a/man/reboot.8 b/man/reboot.8 new file mode 100644 index 0000000..c1ef01b --- /dev/null +++ b/man/reboot.8 @@ -0,0 +1,59 @@ +.TH ninit\-reboot 8 "Dec 28, 2009" +.SH NAME +ninit-reboot \- reboot your system immediately +.SH SYNOPSIS +.B ninit\-reboot +.I RESTART +.br +.B niniy\-reboot +.I HALT +.br +.B ninit\-reboot +.I POWER_OFF +.br +.B ninit\-reboot +.I ENABLE_CAD +.br +.B ninit\-reboot +.I DISABLE_CAD + +.SH DESCRIPTION +.B ninit\-reboot +is used to reboot your system. + +It will not shut down services, unmount filesystems or notify +your users, but expects that this has already been done when it +is called. + +.SH USAGE + +To prevent accidential use of this application the parameters have to +be written in uppercase letters. +.TP 10 +.I RESTART +restart (reboot) the system +.TP +.I HALT +halt the kernel +.TP +.I POWER_OFF +power off the system if possible (supported by hardware) +.TP +.I ENABLE_CAD +halt the system. Enable CTRL\-ALT\-DEL key to restart the system +after halt. +.TP +.I DISABLE_CAD +halt the system. Disable CTRL\-ALT\-DEL key to restart the system +after halt. + + + +.SH AUTHOR +ninit\-reboot was contributed by Tommi Virtanen. + +This manpage was partially written by Erich Schubert <[email protected]> +for the Debian GNU/Linux operating system. + +.SH "SEE ALSO" +ninit(8), nsvc(8), ninit\-shutdown(8), nkillall(8) diff --git a/man/reload.8 b/man/reload.8 new file mode 100644 index 0000000..c8ac521 --- /dev/null +++ b/man/reload.8 @@ -0,0 +1,120 @@ +.TH ninit-reload 8 "Dec 28, 2009" +.SH NAME +ninit\-relaod \- replace running ninit with a new version +.SH SYNOPSIS +.B ninit\-reload +[options] [/path/to/ninit] [ninit_options] + +.SH DESCRIPTION +.B ninit\-reload +is used to replace a running ninit with a new version. + +It tries to retrieve the state information about running services from +ninit, then have ninit replace itself with the new version and +restore the stored state information. + +.SH OPTIONS +Unless the \-u option is given, ninit\-reload assumes you are running +in test mode. +.TP +\-v +verbose operation +.TP +\-u +update mode +.TP +\-m +dump ninit memory buffer to stdout +.TP +\-d +dump services data to stdout +.TP +\-R +.I service +.br +remove +.I service +from active list +.TP +\-r +.I number +.br +remove +service with +.I number +from active list. Example: +.RS + ninit\-reload -v /sbin/ninit +.br + ninit\-reload -v -r 3 -R qmail -u /sbin/ninit +.RE +.TP +\-e +.I string +.br +update ninit environ. Example: +.br +.B ninit\-reload -v -e ABC=12 -e UVW -u /sbin/ninit +.br +This updates the variable +.B ABC +and removes +.B UVW. +See the environ after that with: +.B tr '\\\\000' '\\\\012' < /proc/1/environ +.TP +\-E +.I file +.br +update ninit environ using +.I file. +The syntax for +.I file +is the same as in the file +.I environ +for services. +.TP +\-a +.I number +.br +reload ninit and calculate memory buffer to +.I number +additional services. Check the result with: +.B ps axww. +.TP +\-t +.I time_diff +.br +add +.I time_diff +seconds to each service. Useful if you change the time with hwclock. +.I time_diff +can also be a negative number. +.TP +\-f +.I data_file +.br +don't retrieve services from ninit. Use this file instead. +For example you can start: +.PP +.RS + ninit-reload -d > /tmp/ninit.data +.br + ninit-reload -v -u -f /tmp/ninit.data /sbin/ninit +.RE +.PP + +.SH "ENVIRON" +.B ninit\-reload +uses the variables +.B NINIT_MEMORY +and +.B NINIT_HOME. + + +.SH AUTHOR +This manpage was partially written by Erich Schubert <[email protected]> +for the Debian GNU/Linux operating system. + +.SH "SEE ALSO" +ninit(8), nsvc(8) diff --git a/man/runlevel.8 b/man/runlevel.8 new file mode 100644 index 0000000..bdb05a6 --- /dev/null +++ b/man/runlevel.8 @@ -0,0 +1,108 @@ +.TH ninit-runlevel 8 "Jan 16, 2010" +.SH NAME +ninit-runlevel +\- set runlevels for compatibility with SysVinit +.SH SYNOPSIS +.B ninit-runlevel +.B LEVEL +[OPTION]... [-] [NAME=VALUE]... [PROGRAM [ARG]...] +.br +.B ninit-runlevel +. +.SH DESCRIPTION +.B ninit-runlevel +is a helper program to start service (script, program) with the same +environ as SysVinit. It also modifies the files +.I /var/run/utmp +and +.I /var/log/wtmp +writing runlevel records in them. +It is used mainly in ninit-inittab(8) output script. + +It sets the following variables: +INIT_VERSION=2.86, +CONSOLE=/dev/console, +RUNLEVEL, +PREVLEVEL, +PATH=/bin:/usr/bin:/sbin:/usr/sbin. +The variable NINIT_RUNLEVEL always has the same value +as RUNLEVEL. +The program does not modify or reset the variable INIT_HALT. + +.SH OPTIONS +Actually +.B ninit\-runlevel +has the same syntax between +.B LEVEL +and +.B PROGRAM +as the command env(1). + +If +.B ninit-runlevel +is started as a service you can use +.I environ +file +to set some environment variables. +However in this case +.B ninit-runlevel +overwrites the variables: +INIT_VERSION, +CONSOLE, +RUNLEVEL, +PREVLEVEL, +PATH +and NINIT_RUNLEVEL. +You can reset some of them, for example PATH. +.TP +\-i +start with an empty environment +.br +a mere - implies -i +.TP +\-u +.I variable +.br +remove the +.I variable +from the environment + +.SH "EXAMPLES" +In the next examples we modify PATH, INIT_HALT and CONSOLE + +.B ninit-runlevel S +PATH=/sbin:/bin /etc/rc.d/rc.single +.br +.B ninit-runlevel 0 +INIT_HALT=POWERDOWN -u CONSOLE /etc/rc.d/rc.halt + +See the environ with (don't start it as root \- +the program will then modify +.I /var/run/utmp +) + +.B ninit-runlevel 5 +/usr/bin/env + +.SH WARNING +Don't remove the file +. I /var/run/utmp +if you want correct PREVLEVEL and RUNLEVEL variables. +.B ninit-runlevel +stores the info about levels there. +.B ninit +does not use the +.I /var/run/utmp +file, nor PREVLEVEL, RUNLEVEL, NINIT_RUNLEVEL. + +.SH "FILES" +.I /var/run/utmp +.br +.I /var/log/wtmp + +.SH "SEE ALSO" +utmp(5), env(1), runlevel(8) +.br +ninit(8), ninit\-sysvinit(8), ninit\-shutdown(8), ninit\-inittab(8) +.br +init(1), shutdown(8), reboot(8), halt(8) diff --git a/man/scan.8 b/man/scan.8 new file mode 100644 index 0000000..674a1f9 --- /dev/null +++ b/man/scan.8 @@ -0,0 +1,99 @@ +.TH ninit\-scan 8 "Jan 19, 2010" +.SH NAME +ninit\-scan \- scan directory and start/stop services +.SH SYNOPSIS +.B ninit\-scan +[ +.B \-[uod] +] +.I services_directory +.I ninit_home +. +.SH DESCRIPTION +.B ninit\-scan +scans a directory to start/stop a collection of services. + +Service definitions are installed, configured and activated as subdi- +rectories of the +.I services_directory. +As ninit\-scan sequentially scans the +.I services_directory, +it looks for subdirectory names not beginning with `.'. If +ninit\-scan then finds the `sticky' bit set on the subdirectory, +it considers the service definition ``active'' and +attempts to start/stop the corrsponding service. + + + +.SH OPTIONS +If no option is given +.B ninit\-scan +try to start the service in respawn ON or OFF mode +depending on the existence of the file +.B respawn +in the service subdirectory. + +.TP +.B \-u +Up. +If the service is not running, start it. +If the service stops, restart it. +.TP +.B \-o +Once. +If the service is down, start it. +If the service stops, do not restart it. +.TP +.B \-d +Down. +If the service is running, send it a TERM signal and then a CONT signal. +After it stops, do not restart it. + +.SH EXAMPLES + +.B ninit\-scan \-u net /etc/ninit +.br +start all services /etc/ninit/net/* which have `sticky' bit set +in respawn mode. + +.B ninit\-scan etc /etc/ninit +.br +start all services /etc/ninit/etc/* which have `sticky' bit +set. + +.B ninit\-scan \-d '' /etc/ninit +.br +stop all services /etc/ninit/* which have `sticky' bit set. + +.SH USAGE + +This is similar to the file +.I depends. +Put in +.I rsetup +the following: + +.B #!/bin/sh +.br +.B exec $2/bin/ninit\-scan $1 $2 + + +The program is shell script. See the code to understand how it works. +.B ninit\-scan +is designed to permit easy service activation/deactivation using +the chmod(1) utility. +You can set/unset `sticky' bit with + + +chmod +t myservice +.br +chmod \-t myservice + +.SH AUTHOR +Nikola Vladov. +Thanks to Wayne Marshall for the `sticky' bit idea. +.br +.I http://b0llix.net/perp/ + +.SH SEE ALSO +ninit(8), nsvc(8), perpd(8), chmod(1) diff --git a/man/service.8 b/man/service.8 new file mode 100644 index 0000000..75c3c33 --- /dev/null +++ b/man/service.8 @@ -0,0 +1,46 @@ +.TH ninit\-service 8 "Dec 28, 2009" +.SH NAME +ninit\-service \- print info about a service +.SH SYNOPSIS +.B ninit\-service +[-OPTIONS] service(s) +.br +.B ninit\-service +-E service file +. +.SH DESCRIPTION +.B ninit\-service +is a shell script which prints info about service(s). +It only looks in the service directory. +Use +.B nsvc +to obtain info about services loaded in ninit memory. + +.SH OPTIONS +.TP +\-A ascii output +.TP +\-C show end of lines; for cat +.TP +\-L print long lines; for ls +.TP +\-E +.I service file +.br +edit service/file; +default editor: /bin/vi; change it with: +.br +echo /usr/bin/emacs -nw > /etc/ninit/.editor +.TP +\-H/other/home +default home: /etc/ninit + +.SH EXAMPLE +.B ninit\-service +ngetty +.br +.B ninit\-service +`find /etc/ninit/ -type d` + +.SH "SEE ALSO" +ninit(8), nsvc(8), ngetty(8) diff --git a/man/shutdown.8 b/man/shutdown.8 new file mode 100644 index 0000000..62d6ccf --- /dev/null +++ b/man/shutdown.8 @@ -0,0 +1,89 @@ +.TH ninit-shutdown 8 "Dec 28, 2009" +.SH NAME +ninit-shutdown \- shutdown the ninit init system. +.SH SYNOPSIS +.B ninit-shutdown +\-[\fIrhoqvstmST\fR] [\-E /path/to/program [arg1 arg2 ...]] + +.SH DESCRIPTION +.B ninit-shutdown +tries to properly shutdown your system with ninit. + +.SH USAGE +.TP 9 +\-r +reboot after shutdown +.TP +\-h +halt after shutdown +.TP +\-o +power-off after shutdown (default) +.TP +\-q +quiet mode; ignores SIGINT signal; Ctrl-C does't work! +.TP +\-v +be verbose +.TP +\-m +only shutdown the ninit-part and exit +.TP +\-s \fIsecs\fR +starting delay +.TP +\-t \fIsecs\fR +delay between SIGTERM and SIGKILL +.TP +\-E \fIprog\fR +execute \fIprog\fR after KILLALL; must be the last option! +.TP +\-T \fIsecs\fR +if \fIsecs\fR is nonzero shutdown twice ninit part +.TP +\-S \fIabcd\fR +skip to shutdown the service \fIabcd\fR + +.SH NOTES +If the flags -m and -E are off then the program starts the service +.I halt +or +.I reboot +depending of the flags -h -o and -r respectively. + +If the flags -E and -m are on then +.B ninit-shutdown +execve(2)s the +\fIprog\fR after shutting down the ninit-part. + +If the flag -E is on and the flag -m is off then +.B ninit-shutdown +execve(2)s +the \fIprog\fR after sending SIGTERM and SIGKILL to all processes. + +.B ninit-shutdown +clears respawn/cron flags on all services +including those skipped with -S flag. + +. +.SH "ENVIRON" +.B ninit-shutdown +uses the variables +.B NINIT_MEMORY +and +.B NINIT_HOME. + +.SH AUTHOR +.B ninit +was written by Nikola Vladov and can be downloaded from +.br +.I http://riemann.frmi.uni-sofia.bg/ninit/ + +Parts of +.B ninit-shutdown +were contributed by Bernd Wachter. +.br +Parts of this manpage was written by Erich Schubert. + +.SH "SEE ALSO" +ninit(8), nsvc(8), execve(2), nkillall(8) diff --git a/man/sysvinit.8 b/man/sysvinit.8 new file mode 100644 index 0000000..46a0b77 --- /dev/null +++ b/man/sysvinit.8 @@ -0,0 +1,155 @@ +.TH ninit-sysvinit 8 "Dec 28, 2009" +.SH NAME +ninit-sysvinit \- SysVinit emulator listening on /dev/initctl +.SH SYNOPSIS +.B ninit-sysvinit +.br +.B ninit-sysvinit +powerS + +.SH DESCRIPTION +.B ninit +does not use the +.I /dev/initctl +fifo. As a result the SysVinit commands +telinit, reboot, halt, shutdown do not work. +Some of them need to write to +.I /dev/initctl +to work properly. + +.B ninit-sysvinit +is a SysVinit emulator which listens on +.I /dev/initctl +and starts some services if there is any activity on the fifo. + +.SH USAGE +Five seconds after starting all services +.B ninit +tries to start the sysvinit service. +If the last service exists then +.B ninit +opens and listens on +.I /dev/initctl. +.B Never include +the service sysvinit in +.I /etc/ninit/default +nor start it at boot time. + +.SH OPTIONS +.B ninit\-sysvinit +reads the control file +.I sysvinit\-timeout +in the service directory. +It must contain two numbers n1:n2. +If there is not +any activity on +.I /dev/initctrl +for more than n1 seconds +the program exits. +If the number n1 is zero +.B ninit\-sysvinit +wait forever. + +If needed, +.B ninit +can start +.B ninit\-sysvinit +later again. + +.SH RUNLEVELS +SysVinit has runlevels 0123456S. The command +.br +.B telinit S +.br +writes the request to +.I /dev/initctl +and +.B ninit\-sysvinit +starts the service +.I levelS. +It works similarly with telinit 5, telinit Q or telinit U. +Then +.B ninit\-sysvinit +starts the +.I level5, +.I levelQ +or +.I levelU +service if it exists. + +.SH "POWER ACTIONS" +.B ninit\-sysvinit +also starts the services +.I powerF, +.I powerO +or +.I powerL. +The letters come from F(AIL), O(K) or L(OW). +The program can obtain the power request from +.I /dev/initctl +or from a SIGPWR signal and the file +.I /etc/powerstatus. +See the manual page init(8) for more info. + +.SH SIGNALS +Don't send signal SIGPWR to +.B ninit\-sysvinit. +Manpage init(8) says: + + +Usage of SIGPWR and +.I /etc/powerstatus +is discouraged. Someone wanting to +interact with init should use the +.I /dev/initctl +control channel. + +If some program still needs to use signal SIGPWR +it must send it dirrectly to +.B ninit. + +.SH ENVIRON +SysVinit +.B shutdown +sets the variable +INIT_HALT=POWERDOWN +or +INIT_HALT=HALT +depending on the options +\-r \-h \-H \-P. You can (re)set this variable +using: + +.B nsvc -E INIT_HALT +.br +.B nsvc -E INIT_HALT=POWERDOWN + +.SH "AUTHOR" +If you don't plan to use SysvInit's shutdown, reboot, +halt or telninit commands, you can do: + +.B cd /etc/ninit +.br +.B mv sysvinit sysvinit_ +.br +.B ninit\-reload \-v \-u /sbin/ninit + +Why did I write this SysVinit +.B emulator? +This is a good question. +Ninit has the ninit-shutdown, nkillall and ninit-reboot programs. There +is no need to use SysVinit halt, reboot... to stop the box clean. +See the code of the emulator. Maybe you will find the answer there. + +Nikola Vladov + +.SH FILES +.I /dev/initctl +.br +.I /etc/powerstatus +.br +.I NINIT_HOME/sysvinit/sysvinit\-timeout + +.SH SEE ALSO +nsvc(8), ninit-shutdown(8), ninit-runlevel(8) +.br +init(8), shutdown(8), halt(8), reboot(8), telinit(8) |
