Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch containerd service unit to be After=data.mount on power on #90

Conversation

vasilvas99
Copy link
Contributor

@vasilvas99 vasilvas99 commented Jan 17, 2023

Issue

The kanto-CM service unit being dependent on the data.mount provided a partial fix for the issue of improperly un-mounting the /data partition (most cases when shutdown now and poweroff were used).

However, containerd might continue to use /data even after kanto-cm is stopped, leading to improper un-mounting of the partition when the system was rebooted very soon after startup for example.

Fix

A similar patch for the containerd service unit was provided that makes it depend on the data.mount service on startup (services are stopped in the reverse order on power-off).

Testing

A qemux86-64 and a qemuarm64 leda-distro builds were tested. The system was shut off quickly after a build, rebooted via reboot now and so on. No cases of improper dismount of /data were observed

Power-off logs

...
[  OK  ] Stopped D-Bus System Message Bus.
[  OK  ] Unmounted /run/containerd/…4216-9e02-fcdbe4ee4606/rootfs.
[  OK  ] Unmounted /run/container-management/netns/c8603ff829db.
[  OK  ] Unmounted /run/containerd/…4d72-8442-317765dcaa4f/rootfs.
[  OK  ] Unmounted /run/container-management/netns/4a65d8d364d7.
[  OK  ] Unmounted /run/containerd/…4d60-86f0-f1a5e3fd946e/rootfs.
[  OK  ] Unmounted /run/container-management/netns/66402b492bfa.
[  OK  ] Unmounted /run/containerd/…4090-b7b8-48c3f0a18d4a/rootfs.
[  OK  ] Unmounted /run/container-management/netns/0859b29be63c.
[  OK  ] Unmounted /run/containerd/…46d6-8b65-5022ad5d176b/rootfs.
[  OK  ] Unmounted /run/container-management/netns/516769aeb6b6.
[  OK  ] Unmounted /run/containerd/…47f8-98d9-597686eb8284/rootfs.
[  OK  ] Unmounted /run/container-management/netns/f9d87dd63917.
[  OK  ] Stopped Eclipse Kanto - Container Management.
         Stopping containerd container runtime...
[  OK  ] Stopped containerd container runtime.
[  OK  ] Stopped target Network.
         Unmounting /data...
         Stopping Network Name Resolution...
[  OK  ] Stopped Network Name Resolution.
[  OK  ] Unmounted /data.
...

From the logs it can be observed that the order of services being stopped is:

  1. Unmount containerd virtual files at /run/
  2. Stop Eclipse kanto-cm service (takes a long time)
  3. Stop containerd
  4. Unmount /data

Copy link
Contributor

@stlachev stlachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stlachev stlachev merged commit 376f270 into eclipse-leda:main Jan 17, 2023
@stlachev stlachev deleted the patch-containerd-service-ondata branch January 17, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants