systemd Services and Timers
Cargt images use systemd to start and supervise everything that runs on the
board: Weston, Wi-Fi and Bluetooth bring-up, NetworkManager, SWUpdate and
your own applications. Each of these is a unit, usually a .service
file. This page covers the commands you need day to day. The examples are
from an i.MX 93 00363 on the 00428 carrier, running a wrynose image.
Running Now vs. Starting at Boot
Two separate questions apply to every service: is it running now (active), and does it start at boot (enabled)? Different commands change each one:
Command |
Effect |
|---|---|
|
Start it now. It does not start at the next boot unless it is enabled. |
|
Stop it now. If it is enabled, it starts again at the next boot. |
|
Stop and start it, for example after changing its configuration. |
|
Ask it to reread its configuration without stopping, for services that support it. |
|
Start it at every boot. It does not start it now. |
|
Stop starting it at boot. It does not stop it now. |
|
Enable it and start it now. |
|
Disable it and stop it now. |
Check the two states with is-active and is-enabled, which print one
word per unit:
root@imx93-cargt-00363-00428:~# systemctl is-active weston nxp-wifi swupdate
active
inactive
active
root@imx93-cargt-00363-00428:~# systemctl is-enabled weston nxp-wifi swupdate
enabled
enabled
enabled
nxp-wifi is enabled but inactive, and that is correct: it only loads
the Wi-Fi driver at boot and then exits. weston and swupdate keep
running.
systemctl status <unit> shows both states, the main process and the last
log lines:
root@imx93-cargt-00363-00428:~# systemctl status swupdate
● swupdate.service - SWUpdate daemon
Loaded: loaded (/usr/lib/systemd/system/swupdate.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-10-30 17:08:26 UTC; 20h ago
Invocation: 88b7df9ed3754e6bad75b102363a4633
TriggeredBy: ● swupdate.socket
Docs: https://github.com/sbabic/swupdate
https://sbabic.github.io/swupdate
Main PID: 616 (swupdate)
...
Loaded shows the unit file and whether it is enabled; Active shows
whether it runs. TriggeredBy means a socket unit can also start it on
demand.
Finding Problems
systemctl is-system-running # "running" when nothing has failed, else "degraded"
systemctl list-units --failed # the units that failed
journalctl -u <unit> -b # a unit's log since boot
systemctl reset-failed <unit> # clear a failed state after fixing it
On a board where everything started:
root@imx93-cargt-00363-00428:~# systemctl is-system-running
running
root@imx93-cargt-00363-00428:~# systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
systemctl list-unit-files --state=enabled lists what starts at boot.
Debugging in Linux covers journalctl and the kernel log in more
detail.
Turning a Service Off Completely
A disabled service can still be started by another unit that needs it, or
by its socket. mask prevents it from starting at all, until unmask:
systemctl mask --now <unit>
systemctl unmask <unit>
Use this, for example, to keep a service out of the way while you run the same program by hand.
Looking at and Changing a Unit
systemctl cat prints a unit’s file, and any drop-in files that change
it:
root@imx93-cargt-00363-00428:~# systemctl cat nxp-wifi
# /usr/lib/systemd/system/nxp-wifi.service
[Unit]
Description=NXP WiFi service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/env modprobe moal mod_para=nxp/wifi_mod_para.conf drvdbg=0x00000000
ExecStartPost=/usr/bin/sleep 3
[Install]
WantedBy=multi-user.target
Do not edit files under /usr/lib/systemd: a software update replaces
them. To change a setting, add a drop-in, which overrides only the lines it
contains:
systemctl edit <unit> # opens an editor for /etc/systemd/system/<unit>.d/override.conf
systemctl restart <unit>
systemctl edit reloads systemd for you. If you create or change unit
files any other way, run systemctl daemon-reload before restarting the
unit, or systemd keeps using the old version. To override a setting that
can appear several times, such as ExecStart, clear it first with an
empty line:
[Service]
ExecStart=
ExecStart=/usr/bin/my-wrapper
Files in /etc are on the root file system, which a full software update
replaces, so install your units and drop-ins from your own Yocto layer for
products; see Developing Applications and Kernel Modules.
Timers
A .timer unit starts a service on a schedule, like cron.
systemctl list-timers shows the timers and when each runs next:
root@imx93-cargt-00363-00428:~# systemctl list-timers --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Sat 2026-10-31 17:23:22 UTC 3h 16min Fri 2026-10-30 17:23:22 UTC 20h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
1 timers listed.
A minimal pair that runs a script every 15 minutes, starting 2 minutes after boot. The timer starts the service with the same name:
# /etc/systemd/system/my-report.service
[Unit]
Description=Send a status report
[Service]
Type=oneshot
ExecStart=/usr/bin/my-report.sh
# /etc/systemd/system/my-report.timer
[Unit]
Description=Send a status report every 15 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=15min
[Install]
WantedBy=timers.target
Enable the timer, not the service:
systemctl daemon-reload
systemctl enable --now my-report.timer
systemctl list-timers my-report.timer
OnCalendar=*-*-* 02:00:00 runs at a fixed time of day instead. A timer
that uses wall-clock time needs a correct clock; see Real-Time Clock.
System and User Services
Most units are system units, run by systemd as process 1. systemd can also
run a user manager per logged-in user, with that user’s own units,
controlled with systemctl --user. Weston is the main example, and the
platforms differ:
i.MX: Weston is a system service,
weston.service, running as root:root@imx93-cargt-00363-00428:~# systemctl status weston ● weston.service - Weston, a Wayland compositor, as a system service Loaded: loaded (/usr/lib/systemd/system/weston.service; enabled; preset: enabled) Active: active (running) since Fri 2026-10-30 17:08:27 UTC; 20h ago ...Restart it with
systemctl restart weston.STM32MP2: the system service
weston-graphical-session.servicelogs in thewestonuser and starts Weston as that user’s ownweston.service. Restart the whole session withsystemctl restart weston-graphical-session, or control Weston in thewestonuser’s manager from a root shell:systemctl --user -M weston@ status weston systemctl --user -M weston@ restart weston
This is how ST’s OpenSTLinux layers install Weston; these commands have not yet been tested on a Cargt STM32MP2 board.
The Main Cargt Services
Unit |
What it does |
|---|---|
|
The Wayland compositor (a user unit on STM32MP2; see above) |
|
Loads the Wi-Fi driver at boot (i.MX); see Wi-Fi |
|
Brings up Bluetooth after Wi-Fi; see Bluetooth |
|
Ethernet, Wi-Fi and cellular; see Networking with NetworkManager |
|
SWUpdate and its web interface, and the reboot after an update (i.MX); see Software Updates |
|
Grows and mounts |
On STM32MP2, rauc status shows the update state; see
RAUC A/B OTA Updates — STM32MP2 (00395-01-00365 / 00395-02-00365).