==================================== Ignition ==================================== .. sidebar:: Contents .. contents:: :depth: 2 :local: This chapter describes the configuration of the :osdx:cfg:`service ignition`, which controls the **ignition powerdown timer** in OSDx. The ignition powerdown timer monitors the ignition signal on vehicle-mounted devices. When the ignition is turned off, the device performs an orderly shutdown after a configurable delay. If the ignition is turned back on before the delay expires, the shutdown is cancelled and the device continues operating normally. The countdown is **persisted across reboots**: if the operator (or any other software) reboots the equipment while ignition is off, on the next boot the daemon resumes from the previously accumulated elapsed time. The hardware keeps the equipment powered during the reboot up to its own safety limit. After a shutdown triggered by this service, the next boot reports ``Ignition loss`` as the reboot reason in :osdx:op:`show version`. This feature is currently available on the **H5-Auto** platform. Configuration ============= To enable the ignition powerdown timer, use the :osdx:cfg:`service ignition` command: .. code-block:: none set service ignition Delay ----- This command configures the time (in minutes) the device remains on before performing an orderly shutdown once ignition is turned off. The syntax to set the value for :osdx:cfg:`service ignition delay *` in OSDx is: .. code-block:: none set service ignition delay Where ```` is an integer in the range: * ``0`` — immediate shutdown on ignition loss (default if not set) * ``1`` to ``1440`` — minutes the device stays on after ignition is turned off For example, this command will set a delay of five minutes: .. code-block:: none set service ignition delay 5 .. tip:: During the delay period, if ignition is turned back on, the shutdown will be cancelled and the device will operate normally. This prevents unnecessary reboots caused by brief ignition interruptions. Log level --------- This command sets the logging level of the ignition monitor daemon (messages are written to the system journal). By default, it is set to notice level. The syntax to change the logging level for :osdx:cfg:`service ignition log-level *` in OSDx is: .. code-block:: none set service ignition log-level Where ```` is one of: * **emerg** — emergency messages * **alert** — urgent messages * **crit** — critical messages * **err** — error messages * **warning** — warning messages * **notice** — messages that require further investigation * **info** — information messages * **debug** — debugging messages For example, this command will change the logging level to info: .. code-block:: none set service ignition log-level info SNMP management --------------- .. important:: To better understand how to configure the **Simple Network Management Protocol (SNMP)** service, see :doc:`SNMP documentation `. For the OSDx device to be able to send traps, you will first need to create an SNMP community or user and establish the ``ignition`` service as a target. After the SNMP service is configured, the sending of traps must be enabled by executing the following command in OSDx: .. code-block:: none set service ignition enable-snmp-trap When enabled, the device sends SNMP traps for the following ignition events: * **loss** — ignition off detected, shutdown countdown started * **restored** — ignition turned back on during the delay, shutdown cancelled * **poweroff** — delay expired, device is about to power off Each trap carries the following variable bindings: * ``ignitionHostname`` — hostname of the equipment * ``ignitionState`` — one of ``loss``, ``restored`` or ``poweroff`` * ``ignitionDelay`` — configured powerdown delay, in seconds * ``ignitionElapsed`` — seconds the ignition has been OFF at trap time (``0`` on ``loss``, actual elapsed on ``restored``, equal to ``ignitionDelay`` or close to it on ``poweroff``) Operational commands ==================== Show ignition state ------------------- The :osdx:op:`service ignition show` command reports the live state of the ignition monitor service: current ignition signal, configured delay, time elapsed with ignition OFF, time remaining before shutdown, and whether a shutdown is already in progress. .. code-block:: none admin@osdx$ service ignition show Ignition state : off Configured delay : 5m 0s Elapsed since OFF : 1m 23s Remaining to shutdown : 3m 37s Safety power-hold : 255s Examples ======== To apply the default settings of the ``ignition`` service: .. code-block:: none delete service ignition In this case, the expected behaviour is that, when the ignition is turned off, the device shuts down immediately. To enable the ``ignition`` service with a five-minute delay: .. code-block:: none set service ignition delay 5 In this case, the expected behaviour is that, when the ignition is turned off, the device waits five minutes before shutting down. If the ignition is turned back on within those five minutes, the shutdown is cancelled. To enable the ``ignition`` service with the following settings: * Delay of five minutes. * Logging level set to info messages. * SNMP traps enabled (SNMP service previously configured). .. code-block:: none set service ignition delay 5 set service ignition log-level info set service ignition enable-snmp-trap In this case, the expected behaviour is that, when the ignition is turned off, the service emits info-level entries indicating that ignition loss has been detected and sends an SNMP trap (``loss``). The device then waits five minutes. If the ignition is restored within that time, the shutdown is cancelled, a log message is written, and a second SNMP trap is sent (``restored``). If the ignition is not restored, a final SNMP trap is sent (``poweroff``) and the device performs an orderly shutdown. Command Summary =============== .. osdx:cmdtree:: op service ignition .. osdx:cmdtree:: cfg service ignition