phlogin, phlogin2

Log into Photon

Syntax:

phlogin [options]

phlogin2 [options]

Runs on:

Neutrino

Options:

-B
phlogin only.
Use slow machine screensaver mode. Forces phlogin to use a different screensaver mode (see option -T). Normally, when phlogin enters the screensaver mode, it moves the login dialog smoothly around the screen. If the graphics driver doesn't support hardware blitting, "Slow machine" mode is used, meaning the login dialog is moved to random locations on the screen.
-g file
phlogin only.
Use the given file for the welcome image.
-i
phlogin only.
Don't wait for an input driver.
-L command
Command to run (defaults to ph).
-n
phlogin2 only.
Disable the user-selector icons.
-O
Once: on close, terminate Photon even if $PHINSTANCE is greater than 1. This mode is used when you run Photon remotely from Phindows or phditto.
-P command
Initialization command. For example: phlogin -P "show_splashscreen /etc/config/splash.jpg" - p configure_display. These commands are run in order before the login dialog is displayed.
-p command
One-time initialization command. This option is the same as -P, except the command is run only if $PHINSTANCE is 1.
-R
Repeat: don't terminate Photon if $PHINSTANCE is greater than 1.
-S command
Shutdown command.
-T time
phlogin only.
Enter the "screensaver" mode after this number of seconds.
-U user[:password]
phlogin only.
The user to log in as, and optionally the password to use.

Note: If you specify both a user name and password (or the name of a user who doesn't have a password), the command phlogin executes runs in parallel with the script that has just launched Photon. You should make sure that this doesn't create dangerous race conditions.

For example, the default command that phlogin executes is the ph script. It starts an input driver if one isn't running yet. It may happen that both scripts decide to run an input driver at the same time. Instead of allowing phlogin to run the default ph script, it's better to use a modified version that doesn't attempt to do things that the script that launched Photon takes care of already.


-X
Don't display the dialog's Exit button.

If the -L option is present, -O is the default; -R if not.

Description:

The phlogin and phlogin2 utilities are typically used for nodes that boot directly into Photon or for users who start Photon via a phindows or phditto session.


Note: You can't start these utilities from the command line -- Photon runs one of them automatically if it was started with the -l option. The ph script sets that option if the LOGNAME environment variable isn't set, in particular when tinit is executed with the -p option (which runs the ph script). To pass command line arguments to phlogin or phlogin2, use Photon's -l option. For more information on how to start Photon without using the ph script, see Photon in Embedded Systems in the Photon Programmer's Guide.

The phlogin utility prompts you to enter a userid and optional password through the Photon Login dialog. The phlogin2 utility is a simplified alternative to the phlogin utility. In either utility, you can also click on an Exit or Shutdown button to return to the text-mode console (this runs phlogin or phlogin2 with the -S shutdown command). To prevent users from exiting to text mode, you can disable this button by setting the PHEXIT_DISABLE environment variable to 1.

You can create a configuration file that specifies command line arguments for your shell to run as a login shell. You might want to do this if you require your .profile script to run, for example. The configuration file must have the same name as the shell, and be located in these folders, searched in this order:

  1. ~/.ph/login/shells/
  2. /etc/photon/login/shells/

The configuration file can contain any number of blank lines and comments, followed by a single line of command-line arguments for your shell, including argv[0]. Arguments must be separated by white space. Lines starting with # are comments. The path to ph is appended to the arguments. You can use a backslash to escape a white space character, a backslash, or the # character.

The default is:

- -c

This is equivalent to running your shell with:


Note:

There is no way to specify an empty argument.

The pathname of the ph script is always appended as a separate argument. There is no way to glue it to some other string to form a single argument.


You can pass command line options to phlogin or phlogin2 when you start Photon by using the -l option. For example:

Photon -l 'phlogin -S "myshutdown -v"'

will cause Photon to run phlogin -S "myshutdown -v".

Environment variables:

These environment variables affect phlogin and phlogin2:

LOGNAME
If this environment variable isn't set (such as when ph is run in the sysinit file), ph runs the phlogin utility.
PHLOGIN_NO_FACES
If this environment variable is set, phlogin2 does not display the the user-selector icons.
PHEXIT_DISABLE
Turn off the Exit button so that users won't be able to exit to text mode.
PHINSTANCE
A counter that increments every time phlogin or phlogin2 is launched. This environment variable is used by the -O option to detect whether phlogin or phlogin2 has been run more than once.

See also:

login, ph, tinit

Logging In, Logging Out, and Shutting Down and Managing User Accounts in the Neutrino User's Guide