One DocBook source in docs/guide produces the manual pages, one HTML file, the PDF and an MCDE information library. The guide follows the structure of The NetBSD Guide, describes Makronix 0.99.10 (Camouflage), and has its own chapters for MCDE, the Information Manager and the display. The forms are installed by the release: /usr/share/doc/makronix/makronix-guide.html /usr/share/doc/makronix/makronix-guide.pdf /usr/share/doc/makronix/infolib/makronix.dti/ (base-sys-share) /usr/share/man/man7/makronix-guide*.7 (man-reference-man) /etc/dt/config/Xsession.d/0000makronix (etc-sys-etc) /etc/dt/infolib/en_US.UTF-8/makronix.dti (symlink) The information library is built with MCDE's dtdocbook2infolib from a small Lua writer for the CDE DocBook SGML dialect; tools/test-tools.sh runs docs/guide/check.sh on the installed copies and proves that a missing manual page falls red.
117 lines
4.9 KiB
XML
117 lines
4.9 KiB
XML
<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->
|
|
<chapter id="rc">
|
|
<title>Services and rc.d</title>
|
|
|
|
<para>NetBSD starts services through <command>rc.d</command>: one script
|
|
per service, and one configuration file that decides which of them run.
|
|
Makronix uses the mechanism unchanged; the services that a desktop needs
|
|
are already configured.</para>
|
|
|
|
<sect1 id="rc-conf">
|
|
<title>/etc/rc.conf</title>
|
|
|
|
<para><filename>/etc/rc.conf</filename> holds one variable per service.
|
|
<literal>foo=YES</literal> starts the service at boot,
|
|
<literal>foo=NO</literal> does not. The file is read by
|
|
<citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry>;
|
|
the variables are documented in
|
|
<citerefentry><refentrytitle>rc.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
and in the header of each script.</para>
|
|
|
|
<screen># grep -v '^#' /etc/rc.conf | grep .</screen>
|
|
|
|
<para>A local addition belongs in <filename>/etc/rc.conf</filename>, not
|
|
in a script: it survives an upgrade, and <command>etcupdate</command>
|
|
knows how to merge it. A single service can also be configured in
|
|
<filename>/etc/rc.conf.d/</filename><replaceable>service</replaceable>,
|
|
which is useful when a package or an administrator owns one file.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="rc-scripts">
|
|
<title>Starting, stopping and checking a service</title>
|
|
|
|
<para>The scripts are in <filename>/etc/rc.d</filename>. Each takes the
|
|
verbs <command>start</command>, <command>stop</command>,
|
|
<command>restart</command>, <command>status</command> and
|
|
<command>onestart</command> (start it now without changing
|
|
<filename>rc.conf</filename>):</para>
|
|
|
|
<screen># /etc/rc.d/dhcpcd status
|
|
# /etc/rc.d/dhcpcd restart
|
|
# /etc/rc.d/sshd onestart</screen>
|
|
|
|
<para>A service that fails at boot writes its reason to the console and
|
|
to <filename>/var/log/messages</filename>. A script that is not
|
|
executable, or a variable with a typo, is the usual cause. The order in
|
|
which the scripts run is decided by the <literal>REQUIRE</literal> and
|
|
<literal>PROVIDE</literal> lines at the top of each script, not by the
|
|
alphabetical order; <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
|
prints the order.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="rc-desktop">
|
|
<title>The desktop services</title>
|
|
|
|
<para>On a Makronix desktop the relevant entries are:</para>
|
|
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><literal>dhcpcd=YES</literal></term>
|
|
<listitem><para>The DHCP client, when the network is configured by
|
|
DHCP. A machine with a fixed address sets
|
|
<literal>dhcpcd=NO</literal> and configures the interface in
|
|
<filename>/etc/ifconfig.</filename><replaceable>if</replaceable>.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><literal>sshd=YES</literal></term>
|
|
<listitem><para>The Secure Shell server. The installer enables it;
|
|
the firewall lets it in.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><literal>ntpd=YES</literal></term>
|
|
<listitem><para>Time synchronisation. The server list is
|
|
<filename>/etc/ntp.conf</filename>.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><literal>npf=YES</literal></term>
|
|
<listitem><para>The firewall. Its rules are in
|
|
<filename>/etc/npf.conf</filename>; <xref linkend="firewall"/>
|
|
explains them.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><literal>dtlogin=YES</literal></term>
|
|
<listitem><para>The graphical login. Without it the machine starts
|
|
with a text console; <command>startx</command> is not the same
|
|
thing, and the MCDE session is started by
|
|
<command>dtlogin</command>.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><literal>cupsd=YES</literal></term>
|
|
<listitem><para>The print service, when printing is set up
|
|
(<xref linkend="printing"/>).</para></listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</sect1>
|
|
|
|
<sect1 id="rc-add">
|
|
<title>Adding a service</title>
|
|
|
|
<para>A service that comes from pkgsrc installs its own script in
|
|
<filename>/usr/pkg/share/examples/rc.d</filename> or
|
|
<filename>/etc/rc.d</filename>. Copy it into
|
|
<filename>/etc/rc.d</filename> if it is an example, make it executable,
|
|
add the variable to <filename>/etc/rc.conf</filename>, and start it once
|
|
to see whether it works before the next boot:</para>
|
|
|
|
<screen># cp /usr/pkg/share/examples/rc.d/foo /etc/rc.d/foo
|
|
# chmod 755 /etc/rc.d/foo
|
|
# echo 'foo=YES' >> /etc/rc.conf
|
|
# /etc/rc.d/foo start
|
|
# /etc/rc.d/foo status</screen>
|
|
|
|
<para>If the service needs a directory or a user, its package
|
|
documentation says so; <command>pkg_info -D foo</command> prints the
|
|
message that came with the package.</para>
|
|
</sect1>
|
|
</chapter>
|