Name

nstboot — Used to manage start-up and shutdown actions related to NST.

Synopsis

nstboot [ --move [true]|false ] [ --shutdown [true]|false ] [ --poweroff [true]|false ] [ --reboot [true]|false ] [ --halt [true]|false ] [ --boot [true]|false ] [ --grub2 [true]|false ] [ -h [true]|false | --help [true]|false ] [ -H [true]|false | --help-long [true]|false ] [ -v [true]|false | --verbose [true]|false ] [ --version [true]|false ]

Description

The nstboot is mainly used internally by the NST system to help manage the various combinations (modes) in which the system can be run from. This script is typically invoked during the boot or shutdown stages of the system.

While you will typically never need to directly use this script, if you are booting your NST system from writable removable media (a USB thumb drive), you can use the following command to shutdown the system when you are planning on moving the system to new hardware:

[root@probe ~]# nstboot --move --shutdown

Broadcast message from root@probe
	(/dev/pts/2) at 10:33 ...

The system is going down for power off NOW!
[root@probe ~]# 

This is all that you will typically need to know about this script. The remainder of the documentation involves technical notes for the NST developers.

Technical Details

A NST system can be booted in the following manners:

  • A "Live" boot from read-only media (DVD).

  • A "Live" boot from writable media with a "persistent" layer (USB thumb drive).

  • A hard disk installation with full read/write access (internal SATA drive).

  • A hard disk installation to removable media (a external USB drive or USB thumb drive).

  • A "Live" boot from a read-only media running within a VMware virtual machine.

  • A hard disk installation running within a VMware virtual machine.

Each of the above mentioned boot conditions requires special attention. The nstboot script is used to help deal with the different issues involved.

The way in which a ISO image is treated as a writable disk during a live boot causes the system to use up RAM as files are "written". To avoid some of this memory loss, the nstboot script will relocate some directories to a tmpfs file system if the "nstrelocate=true" option is specified on the kernel boot parameter line. This option is recommended if you intend to run from a live boot for a extended period of time.

Options

The following command line options are available:

[--move [true]|false]

If your system is booting from writable and removable media (such as a USB memory stick), it will likely persist information between boots. If you then move the installation to new hardware, it is likely that the persisted information will be incorrect for the new hardware. The "--move" option is used to deal with this situation. It removes hardware specific configuration files so that they will be recreated at boot time.

[--shutdown [true]|false]

If this option is specified, the system will be shutdown and powered off after completing all other operations.

[--poweroff [true]|false]

If this option is specified, the system will be shutdown and powered off after completing all other operations. This option is the same as the "--shutdown" option.

[--reboot [true]|false]

If this option is specified, the system will be rebooted after completing all other operations.

[--halt [true]|false]

If this option is specified, the system will be shutdown and halted after completing all other operations. This option will not "power off" the system.

[--boot [true]|false]

Pass this option when running the script from the end of the script: "/etc/init.d/livesys" for an NST Live boot or within script: "/etc/init.d/nstinit" for an NST hard disk install. This will examine the boot state of the system and run various commands accordingly. This option should not be used directly from the command line. When this runs, it will look for the string: "nstmove" in /proc/cmdline (boot options). If found, it is assumed that you are booting the system on new hardware and need to have any pre-existing hardware specific configuration files removed. After the files are removed, the system will automatically reboot. Other NST specific boot command line options include: "nstreboot". The "nstreboot" option will reboot the system at completion of running the "/etc/init.d/livesys" or the "/etc/init.d/nstinit" script. Typically, this option is used in conjuction with other boot command line options (e.g., "reset_overlay"). Finally, the "--boot" option will also perform a set of Gnome 3 tweaks specific to NST system initialization (e.g., Set the default background color for the GDM login greeter and the user 'root'). These tweaks are typically performed once during the first NST boot.

[--grub2 [true]|false]

This option will rebuild the 'Grub2' configuration file: "/boot/grub2/grub.conf" using the NST tweak script: "/etc/nst/tweak/09nst-config-grub2.tweak". Typically, after receiving a new Kernel update or making a change to the NST default Grub2 configuration file: "/etc/nst/grub2/nst_grub2_defaults" this option can be used to rebuild the 'Grub2' configuration file.

[-h [true]|false] | [--help [true]|false]

When this option is specified, nstboot will display a short one line description of nstboot, followed by a short description of each of the supported command line options. After displaying this information nstboot will terminate.

[-H [true]|false] | [--help-long [true]|false]

This option will attempt to pull up additional nstboot documentation within a text based web browser. You can force which browser we use setting the environment variable TEXTBROWSER, otherwise, we will search for some common ones.

[-v [true]|false] | [--verbose [true]|false]

When you set this option to true, nstboot will produce additional output. This is typically used for diagnostic purposes to help track down when things go wrong.

[--version [true]|false]

If this option is specified, the version number of the script is displayed.

Files

/usr/share/nstboot

Directory containing resource files used by nstboot.

/etc/init.d/livesys

NST Live system initialization script run at boot time prior to other init.d service scripts.

/etc/init.d/nstinit

NST hard disk installation system initialization script run at boot time prior to other init.d service scripts.

/proc/cmdline

Information about the command line options passed to the kernel at boot time.

/etc/nst/nstpasswd.conf

When the "--boot" option is specified, then this configuration file is used to indicate the state of the system and clear text passwords. If the variable NSTPASSWD_STATE from the file does not have the value of "set", then the nstpasswd command will be run at boot time to initialize the system level passwords. If the NSTCTPASSWD_STATE does not have the value of "set", then the system clear text passwords will be initialized with randomly generated values. This file will be rewritten should the state change. If this file is not present on the system, each variable will be set to a value of "initial" (thus forcing password generation).

Environment

TEXTBROWSER

This controls what text based browser is used to display help information about the script. If not set, we will search your system for available text-based browsers (Ex: elinks, lynx ...).

See Also

nstpasswd(1), nstvmware(1), Network Security Toolkit