changeset 585:75c8521c9b7a

core/rc: add initial documentation
author David Demelier <markand@malikania.fr>
date Mon, 08 Jul 2019 20:30:00 +0200
parents 82e07854bdd6
children 1218a8f753b6
files core/rc/rc.7 core/rc/rc.conf.5 core/rc/rc.sh
diffstat 3 files changed, 153 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/rc/rc.7	Mon Jul 08 20:30:00 2019 +0200
@@ -0,0 +1,54 @@
+.\"
+.\" Copyright (c) 2019 David Demelier <markand@malikania.fr>
+.\"
+.\" Permission to use, copy, modify, and/or distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd July 08, 2019
+.Dt RC 7
+.Os
+.Sh NAME
+.Nm rc
+.Nd vanilla init scripts
+.Sh DESCRIPTION
+Vanilla runs either
+.Ar busybox
+or
+.Ar sysvinit
+init daemons. The former one is more minimalistic and does not support runlevels
+while sysvinit is more traditional.
+.Sh FILES AND DIRECTORIES
+All files specified here are user editable and protected by
+.Nm vpk .
+Therefore, you can safely edit them for your own purposes.
+.Pp
+The following files and directories are understood by Vanilla's init process:
+.Bl -tag -width indent-xxxxxxxxxx
+.It Pa /etc/rc.conf
+The global configuration file for system initialization and basic configuration.
+See
+.Xr rc.conf 5
+for more details.
+.It Pa /etc/rc.init
+File executed early by boot process to perform the machine initialization. It
+mounts filesystem, checks devices sets configuration from
+.Pa /etc/rc.conf
+file.
+.It Pa /etc/rc.start
+This script is executed after the initialization and start users services. It
+takes a runlevel number as argument which is in the range 0-6.
+.It Pa /etc/rc.shutdown
+This file is executed when the machine is going off. Its purpose is to shutdown
+all processed, unmount filesystem and halts the machine.
+.El
+.Sh SEE ALSO
+.Xr rc.conf 5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/rc/rc.conf.5	Mon Jul 08 20:30:00 2019 +0200
@@ -0,0 +1,96 @@
+.\"
+.\" Copyright (c) 2019 David Demelier <markand@malikania.fr>
+.\"
+.\" Permission to use, copy, modify, and/or distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd July 08, 2019
+.Dt RC.CONF 5
+.Os
+.Sh NAME
+.Nm rc.conf
+.Nd system configuration
+.Sh DESCRIPTION
+The file
+.Nm
+contains information about the system.
+.Pp
+It is evaluated at boot time when
+.Pa /etc/rc.init
+is started from init and performs initialization. The file is sourced from a
+shell script and therefore can contain shell code.
+.Pp
+The following options are available:
+.Bl -tag -width indent-two
+.It Va HOSTNAME
+Sets the machine hostname. (Default: localhost)
+.It Va TIMEZONE
+Sets the time zone. You can get a list of timezones in the
+.Pa /share/zoneinfo
+directory. The variable must be in the form
+.Ar Area/Region .
+(Default: empty)
+.It Va SERVICES
+This variable contains services to be started at boot. In Vanilla, services have
+no dependencies and therefore user is responsible of starting them is a specific
+order if needed. Thus, services marked in this list separated by spaces are
+executed in order.
+.Pp
+Services names are in the form
+.Ar name[:N]
+where name is the actual service file located in
+.Pa /etc/rc.d
+directory. The optional
+.Ar N
+argument is the minimal runlevel number required to start this service. For
+example, a value of 3 means that the service will be started only if the desired
+runlevel is 3 or higher.
+.Pp
+Some services offer tunables to pass additional configuration to them. See the
+service file header for more information.
+.Pp
+Note: don't forget to mark the service file as executable or it won't be
+executed by init process. (Default: empty)
+.It Va FONT
+Sets the console font. A list is available in /share/kbd/consolefonts. (Default:
+empty).
+.Pp
+Note: this requires package
+.Ar kbd
+to be installed.
+.It Va KEYMAP
+Sets the console keymap. A list is available in /share/kbd/keymaps. (Default:
+empty).
+.Pp
+Note: this requires package
+.Ar kbd
+to be installed.
+.El
+.Sh EXAMPLES
+.Ss Starting sysklogd package
+In this example we will start
+.Ar sysklogd
+from the runlevel 2 and higher.
+.Pp
+The
+.Ar sysklogd
+package understand the variable
+.Va SYSKLOGD_ARGS
+and may be used instead. However, please note that setting this variable replace
+the original arguments so double check the service file before setting any
+variable.
+.Bd -literal
+SYSKLOGD_ARGS="-4"
+SERVICES="sysklogd:2"
+.Ed
+.Sh SEE ALSO
+.Xr rc 7
--- a/core/rc/rc.sh	Mon Jul 08 20:27:00 2019 +0200
+++ b/core/rc/rc.sh	Mon Jul 08 20:30:00 2019 +0200
@@ -16,7 +16,7 @@
 #
 
 PKGNAME=rc
-PKGVERSION=0.1
+PKGVERSION=0.2
 PKGREVISION=1
 PKGLICENSE="ISC"
 PKGSUMMARY="vanilla init scripts"
@@ -31,4 +31,6 @@
 	install -Dm0755 rc.init $DESTDIR/etc/rc.init
 	install -Dm0755 rc.shutdown $DESTDIR/etc/rc.shutdown
 	install -Dm0755 rc.start $DESTDIR/etc/rc.start
+	install -Dm0755 rc.conf.5 $DESTDIR/share/man/man5/rc.conf.5
+	install -Dm0755 rc.7 $DESTDIR/share/man/man7/rc.7
 }