Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 16:09:49 -0400
From:      Tom Rhodes <trhodes@FreeBSD.org>
To:        FreeBSD-doc@FreeBSD.org
Subject:   Another patch :)
Message-ID:  <20030528160949.79ba5c08.trhodes@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Gang,

This patch was submitted to me.  I've made a few simple changes and
to me it looks good.  Some of you, however, may want to read over
it before I invoke cvs.

Thanks,

--
Tom Rhodes

NOTE: This is my second patch, I'll assume I can commit them both if
I hear nothing in a respectable period of time.


Index: config/chapter.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/config/chapter.sgml,v
retrieving revision 1.105
diff -u -d -r1.105 chapter.sgml
--- config/chapter.sgml	27 May 2003 20:27:26 -0000	1.105
+++ config/chapter.sgml	27 May 2003 22:08:17 -0000
@@ -593,6 +593,55 @@
        any other dependent services during the next reboot, as
        described below.</para>
 
+    <para>Since the <filename>rc.d</filename> system is primarily
+      intended to start/stop services at system startup/shutdown time;
+      the standard <option>start</option>,
+      <option>stop</option> and <option>restart</option> options will only
+      perform their action if the appropriate
+      <filename>/etc/rc.conf</filename> variables are set.  For
+      instance the above <command>sshd restart</command> command will
+      only work if <varname>sshd_enable</varname> is set to
+      <option>YES</option> in <filename>/etc/rc.conf</filename>.  To
+      <option>start</option>, <option>stop</option> or
+      <option>restart</option> a service regardless of the settings in
+      <filename>/etc/rc.conf</filename>, the commands should be
+      prefixed with <quote>force</quote>.  For instance to restart
+      <command>sshd</command> regardless of the current
+      <filename>/etc/rc.conf</filename> setting, execute the following
+      command:</para>
+
+    <screen>&prompt.root; <userinput>/etc/rc.d/sshd forcerestart</userinput></screen>
+
+    <para>Its easy to check if a service is enabled in
+      <filename>/etc/rc.conf</filename> by running the appropriate
+      <filename>rc.d</filename> script with the option
+      <option>rcvar</option>.  Thus, an administrator can check that
+      <command>sshd</command> is in fact enabled in
+      <filename>/etc/rc.conf</filename>, by running:</para>
+
+    <screen>&prompt.root; <userinput>/etc/rc.d/sshd rcvar</userinput>
+# sshd
+$sshd_enable=YES</screen>
+
+    <note>
+      <para>The second line (<literal># sshd</literal>) is the output
+        from the <command>sshd</command> command; not a <username>root</username>
+        console.</para>
+    </note>
+
+    <para>To determine if a service is running, a
+      <option>status</option> option is available.  For instance to
+      verify that <command>sshd</command> is actually started:</para>
+
+    <screen>&prompt.root; <userinput>/etc/rc.d/sshd status</userinput>
+sshd is running as pid 433.</screen>
+
+    <para>It is also possible to <option>reload</option> a service.
+      This will attempt to send a signal to an individual service, forcing the
+      service too reload it's configuration files.  In most cases this
+      means sending the service a <literal>SIGHUP</literal>
+      signal.</para>
+
     <para>The <application>rcNG</application> structure is not only used for network services, it also
       contributes to most of the system initialization.  For
       instance, consider the <filename>bgfsck</filename> file.  When
@@ -637,6 +686,10 @@
     <para>Using this method an administrator can easily control system
       services without the hassle of <quote>runlevels</quote> like
       some other &unix; operating systems.</para>
+
+    <para>Additional information about the &os; 5.X
+      <filename>rc.d</filename> system can be found in the &man.rc.8;
+      and &man.rc.subr.8; manual pages.</para>
   </sect1>
 
   <sect1 id="config-network-setup">



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030528160949.79ba5c08.trhodes>