Preventing respawns with systemd

6.10 LPAR mode z/VM guest

If your distribution uses systemd, use the ttyrun service to prevent systemd from respawning the getty program for non-operational HVC terminals (hvc1 to hvc7).

Before you begin

You require a service unit that is included in the s390-tools package. When installing the s390-tools package, you must set the installation directory for the unit with the SYSTEMDSYSTEMUNITDIR make variable. This directory depends on where your distribution maintains the systemd system unit directory, usually /lib/systemd/system or /etc/systemd/system. If you do not set the SYSTEMDSYSTEMUNITDIR parameter, the template is not installed with the s390-tools package.

About this task

If user logins are enabled on unavailable HVC terminals hvc1 to hvc7, systemd might keep respawning the getty program. To be free to change the conditions that affect the availability of these terminals, use the ttyrun service to enable user logins for them. HVC terminals are operational only in a z/VM® environment, and they depend on the hvc_iucv= kernel parameter.

Any other unavailable terminals with enabled user login, including hvc0, do not cause problems with systemd.

Procedure

Perform these steps to use a ttyrun service for enabling user logins on a terminal:

  1. Enable the ttyrun service by issuing a command of this form:
    # systemctl enable ttyrun-getty@hvc<n>.service
    where hvc<n> specifies one of the terminals hvc1 to hvc7.
  2. Optional: Start the new service by issuing a command of this form:
    # systemctl start ttyrun-getty@hvc<n>.service

Results

At the next system start, systemd starts the ttyrun service for hvc<n>. The ttyrun service starts a getty only if this terminal is available.

Example

For hvc1, issue:
# systemctl enable ttyrun-getty@hvc1.service
# systemctl start ttyrun-getty@hvc1.service