What files to clean up after power loss

What temporary system files that need to be clean up after a power lost?

The details:
During boot up, I use systemd services to automatically log into the “debian user” then launch an X11 GUI running on the Beaglebone without using the gdm desktop manager. This GUI is the only application running on the debian system.

I am simulating a power lost to my Beaglebone. I found that about 10% of the time the gui did not load after a simulated power lost. I have cleaned the /tmp/* files which removes the .X*-lock, serverauth.* and the .Xauthority files. Yet the problem still exist, are there other files I need to pre-clean the system before I launch the gui application after a power lost?

Regards,
Sy

If memory serves, BeagleBoard uses LightDM rather than GDM on ARM setups, and that’s likely for good reason. In my experience, LightDM has been more stable on ARM devices, whereas GDM can be a bit touchy, especially when managing desktop sessions on limited resources.

When it comes to testing for power loss resilience, we’re simulating real-world conditions by pulling the plug and even wiggling the connector. It’s pretty close to an actual unexpected power drop. However, I don’t think dirty files are the main issue here. Instead, consider these adjustments:

  1. Add Delays: It might help to add delays in the startup sequence to let services load more sequentially, reducing the load spikes on the system.
  2. Systemd Configuration: Make sure systemd is managing dependencies correctly. With a multicore setup, you may need to explicitly define the sequence for desktop and related services to start. Starting the desktop environment is resource-intensive, and a defined startup order can prevent services from clashing.

This approach might help stabilize the boot process and ensure that the desktop starts reliably, even in power recovery situations.

Thanks for this information.

Thanks for the suggestion. I have already incorporated the delay in the service file. Here is my systemd service file.


[Unit]
Description=Service for Application Loader
After=getty@tty1.service
After=multi-user.target

[Service]
Type=simple
Restart=no
TimeoutStartSec=300 #in seconds
TimeoutStopSec=infinity

beaglebone display default to tty1
TTYPath=/dev/tty1
StandardOutput=tty
StandardError=append:/home/debian/myProject/log/autoexec_error.log

#Launch appl loader from a script which passes in argument to the appl loader
User=debian
Group=debian

WorkingDirectory=/home/debian/myProject/bin
ExecStart=/home/debian/myProject/utils/auto_load_systemd.sh

[Install]
WantedBy=multi-user.target


The auto_load_systemd.sh launches the application and pass in the arguments.