[Previous] [Contents] [Next]

sinit

System initialization (QNX)

Syntax:

sinit [-i initfile] [-r root] [-s shell]
      [var=value]...

Options:

-i initfile
Open this system initialization file (for defaults, see the Description below).
-r root
Define an alias prefix for the filesystem root (/).
-s shell
Invoke this shell (default is /bin/sh).
-w
Wait for a name locator to communicate with our node. Only useful for disk boot. See also nameloc -k.
var=value
Define an environment variable.

Description:

The sinit utility sets up the initial operating system environment immediately after boot. It is usually bound into the operating system image by means of the buildqnx utility.

To run successfully, sinit needs to access a filesystem that contains a shell that can process the system initialization file. This filesystem can be local (a hard disk on that machine) or remote (a hard disk on another machine). If the filesystem is local, the image must contain the Filesystem Manager (Fsys) and a disk driver to access the local disk. If the filesystem is remote, the image doesn't need the Filesystem Manager, but will require the Network Manager (Net) and an appropriate network driver to access the remote filesystem over the network.

The sinit utility attempts to find and open the system initialization file for your node. This is a text file that contains a list of system initialization commands for which sinit invokes a shell to execute.

There are two boot types: a normal boot and an alternate boot. All boots over the network are considered normal. When you boot from disk, you are prompted with the option of doing an alternate boot. The type of boot you choose determines which system initialization file will be used.

If you choose: sinit tries to find and open:
a normal boot /etc/config/sysinit.node
If this fails, it tries:
/etc/config/sysinit
an alternate boot /etc/config/altsysinit
If this fails, it tries:
/etc/config/sysinit

It's usually a good idea to keep the sysinit file generic and create custom sysinit.node files for each node as required. The altsysinit file is usually a backup of the sysinit.node file for the node that boots from its own hard disk.

Whenever you wish to get your files from another node (remote file server), use the -r root option. If you boot from a hard disk and get your files from a local hard disk, you don't need to specify this option.

You can override the default search for sysinit.node or altsysinit by specifying an explicit filename with the -i initfile option.

The default shell invoked by sinit is /bin/sh. To override this default, use the -s shell option. You should specify a complete pathname for the shell, starting with a slash (/).

You can cause sinit to create an environment variable using the var=value operand. These environment variables will be inherited by the system initialization shell. The time zone variable (TZ) is often set here.


Note: The sinit utility always terminates; it doesn't stay resident in the system. User logins etc. are started by the terminal initialization utility, tinit, which should be started in the sysinit file for the machine in question.

Examples:

Initialize the system, using the filesystem on node 1 instead of a local disk (which may be absent):

    sinit -r //1/

Initialize the system using the shell /bin/myshell:

    sinit -s /bin/myshell

See also:

buildqnx, tinit

Installation & Configuration


[Previous] [Contents] [Next]