From 9249f68f8436fd437f563949ec447e787123d78c Mon Sep 17 00:00:00 2001 From: Samkit Shah Date: Wed, 26 Jul 2023 16:43:55 -0400 Subject: [PATCH] Changes to nvidia.service to allow ordering on the subsequent services When changed to oneshot, the subsequent services wiill actually wait for the nvidia.service to finish, i.e. wait for drivers to be installed. The subsequent services can be configured to wait for nvidia.service. This needs to be coupled with RemainAfterExit=yes to ensure it doesn't get kicked-off automatically again. Solves : https://github.com/flatcar/Flatcar/issues/1136 --- changelog/changes/2023-08-08-change-nvidia-oneshot.md | 1 + .../x11-drivers/nvidia-drivers/files/units/nvidia.service | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/changes/2023-08-08-change-nvidia-oneshot.md diff --git a/changelog/changes/2023-08-08-change-nvidia-oneshot.md b/changelog/changes/2023-08-08-change-nvidia-oneshot.md new file mode 100644 index 00000000000..e1543d54b74 --- /dev/null +++ b/changelog/changes/2023-08-08-change-nvidia-oneshot.md @@ -0,0 +1 @@ +- Change nvidia.service to type oneshot (from the default "simple") so the subsequent services (configured with "Requires/After") are executed after the driver installation is successfully finished (flatcar/Flatcar#1136) diff --git a/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/units/nvidia.service b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/units/nvidia.service index 1b36dfe873c..66575b65824 100644 --- a/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/units/nvidia.service +++ b/sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers/files/units/nvidia.service @@ -2,9 +2,11 @@ Description=NVIDIA Configure Service Wants=network-online.target After=network-online.target +Before=containerd.target [Service] -Type=simple +Type=oneshot +RemainsAfterExit=true Restart=no Environment=PATH=/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin ExecStart=/usr/lib/nvidia/bin/setup-nvidia