Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions elements/cloud-init-mlx5/install.d/95-cloud-init-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Exit immediately if a command exits with a non-zero status (-e),
# treat unset variables as an error and exit immediately (-u),
# and ensure that a pipeline fails if any part fails (-o pipefail).
set -euo pipefail

# Display a message indicating the purpose of the script
echo "Creating systemd override for cloud-init-local.service to ensure it starts systemd-udev-settle.service"

# Define the path to the systemd override directory
OVERRIDE_DIR="/etc/systemd/system/cloud-init-local.service.d"

# Create the override directory if it doesn't already exist
mkdir -p "${OVERRIDE_DIR}"

# Define the path to the override file
OVERRIDE_FILE="${OVERRIDE_DIR}/udev-settle-override.conf"

# Write the override configuration
cat <<EOF >"${OVERRIDE_FILE}"
[Unit]
Wants=systemd-udev-settle.service
After=systemd-udev-settle.service
EOF

# Ensure correct permissions
chmod 755 "${OVERRIDE_DIR}"
chmod 644 "${OVERRIDE_FILE}"

# Display a message indicating that the override has been created
echo "Systemd override for cloud-init-local.service created successfully"
5 changes: 5 additions & 0 deletions elements/cloud-init-mlx5/install.d/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
===============
cloud-init-mlx5
===============

Configures cloud-init-local.service with configuration to ensure cloud-init only starts after systemd-udev-settle.service