Skip to content

Debugging

Tristan Israël edited this page Feb 22, 2026 · 5 revisions

This page explains how to debug a system running with Safecor.

Enable debugging

In order to activate the debugging facilities, the file /etc/default/grub must be modified. Add the sequence debug=on (with a space before if needed) at the end of the line GRUB_CMDLINE_LINUX_DEFAULT.

Disable splash screen

Disabling the splash screen might be necessary to see boot messages. In this case add the option nosplash to the kernel command line in GRUB during the boot or in the file /etc/default/grub at the end of the line GRUB_CMDLINE_LINUX_DEFAULT.

Prevent Domains auto-start

By default the Domains are started during the boot of the system. In order to prevent them for starting automatically, the keyword no_autostartcan be added to the kernel command line.

RS-232 Serial link

The main debugging channel uses the RS-232 serial port of the system when it has one. Otherwise an USB-serial device can be used as long as its chipset is recognized by the kernel embedded in the sys-usb DomD.

PTY terminal

After connecting a serial cable (RS-232 or USB), a serial connection can be opened with the following settings:

  • speed: 9 600 bps
  • bits : 8
  • parity : none
  • stop bits: 1

After opening a serial connection a login prompt is opened.

If no login has been provided in the topology file the session can be opened as root.

MQTT console

After logging in the system, the MQTT broker can be queried using the command mosquitto_sub and connect it on the local MQTT socket located at /vr/run/mqtt_msg_local.sock.

For example:

$ mosquitto_sub --unix /var/run/mqtt_msg_local.sock -t '#' --pretty -v

Debug messages

Safecor provides scripts for messages debugging:

  • /usr/lib/safecor/bin/show-messages.sh connects to the MQTT broker and displays all the messages with their payload.
  • /usr/lib/safecor/bin/show-logs.sh connects to the MQTT broker and displays all the logging messages (and only them).

Log files

When in debug mode the following log files are created:

Location Description
/var/log/safecor/messages.log This log contains all MQTT messages.

Verify whether debug is activated

There are two ways of knowing whether debug is activated:

  • On Dom0 : $ grep -i debug=on /proc/cmdline
  • Using the Api : Api().request_system_info(). The JSON returned contains core.debug_on which is a boolean. Example :
{
    "core": {
        "version": "2.0.0",
        "debug_on": true
    }
}

Kernel parameters summary

The following table summarizes the kernel parameters used for debugging:

Parameter Action
debug=on Activates the debug mode for the system. Enables a serial TTY console.
nosplash Disables splash screen during the boot.
no_autostart Prevents the Domains to be automatically started during the boot.

Clone this wiki locally