Update the troubleshooting section for systemd

This commit is contained in:
Eelco Dolstra 2013-01-09 13:43:57 +01:00
parent 19127aa416
commit b5e639dbb1
2 changed files with 46 additions and 36 deletions

View File

@ -59,7 +59,7 @@ in rec {
mkdir -p $dst/images/callouts mkdir -p $dst/images/callouts
cp ${pkgs.docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/ cp ${pkgs.docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
cp ${./style.css} $dst/style.css cp ${./style.css} $dst/style.css
ensureDir $out/nix-support ensureDir $out/nix-support

View File

@ -4,60 +4,70 @@
<title>Troubleshooting</title> <title>Troubleshooting</title>
<section> <section><title>Boot problems</title>
<title>Debugging the boot process</title>
<para>To get a Stage 1 shell (i.e., a shell in the initial ramdisk), <para>If NixOS fails to boot, there are a number of kernel command
add <literal>debug1</literal> to the kernel command line. The shell line parameters that may help you to identify or fix the issue. You
gets started before anything useful has been done. That is, no can add these parameters in the GRUB boot menu by pressing “e” to
modules have been loaded and no file systems have been mounted, except modify the selected boot entry and editing the line starting with
for <filename>/proc</filename> and <filename>/sys</filename>.</para> <literal>linux</literal>. The following are some useful kernel command
line parameters that are recognised by the NixOS boot scripts or by
systemd:
<para>To get a Stage 2 shell (i.e., a shell in the actual root file <variablelist>
system), add <literal>debug2</literal> to the kernel command
line. This shell is started right after stage 1 calls the stage 2
<literal>init</literal> script, so the root file system is there but
no services have been started.</para>
</section> <varlistentry><term><literal>debug1</literal></term>
<listitem><para>Request an interactive shell in stage 1 of the
boot process (the initial ramdisk). The shell gets started before
anything useful has been done. That is, no modules have been
loaded and no file systems have been mounted, except for
<filename>/proc</filename> and
<filename>/sys</filename>.</para></listitem>
</varlistentry>
<varlistentry><term><literal>single</literal></term>
<listitem><para>Boot into rescue mode (a.k.a. single user mode).
This will cause systemd to start nothing but the unit
<literal>rescue.target</literal>, which runs
<command>sulogin</command> to prompt for the root password and
start a root login shell. Exiting the shell causes the system to
continue with the normal boot process.</para></listitem>
</varlistentry>
<varlistentry><term><literal>systemd.log_level=debug systemd.log_target=console</literal></term>
<listitem><para>Make systemd very verbose and send log messages to
the console instead of the journal.</para></listitem>
</varlistentry>
<section> </variablelist>
<title>Safe mode</title>
<para>If the hardware autodetection (in For more parameters recognised by systemd, see
<filename>upstart-jobs/hardware-scan</filename>) causes problems, add <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
<literal>safemode</literal> to the kernel command line. This will
disable auto-loading of modules for your PCI devices. However, you <para>If no login prompts or X11 login screens appear (e.g. due to
will probably need to explicitly add modules to hanging dependencies), you can press Alt+ArrowUp. If youre lucky,
<option>boot.kernelModules</option> to get network support etc.</para> this will start rescue mode (described above). (Also note that since
most units have a 90-second timeout before systemd gives up on them,
the <command>agetty</command> login prompts should appear eventually
unless something is very wrong.)</para>
</section> </section>
<section> <section>
<title>Maintenance mode</title> <title>Maintenance mode</title>
<para>You can go to maintenance mode by doing <para>You can enter rescue mode by running:
<screen> <screen>
$ shutdown now</screen> $ systemctl rescue</screen>
This will eventually give you a single-user root shell. This will eventually give you a single-user root shell. Systemd will
stop (almost) all system services. To get out of maintenance mode,
To get out of maintenance mode, do just exit from the rescue shell.</para>
<screen>
$ initctl emit startup</screen>
</para>
</section> </section>
</chapter> </chapter>