From a94405ff8a093dabf29d8210f786daba3cc7f28d Mon Sep 17 00:00:00 2001 From: Heewa Barfchin Date: Wed, 3 Jun 2026 02:46:11 -0400 Subject: [PATCH] Write alpine service scripts directly --- bootstrap-salt.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e18f72a74..363b7bd0a 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5492,15 +5492,22 @@ install_alpine_linux_post() { [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /sbin/rc-update ]; then - script_url="${_SALTSTACK_REPO_URL%.git}/raw/master/pkg/alpine/salt-$fname" - [ -f "/etc/init.d/salt-$fname" ] || __fetch_url "/etc/init.d/salt-$fname" "$script_url" + local script_path="/etc/init.d/salt-$fname" + if ! [ -f "$script_path" ]; then + cat <<_eof > "$script_path" +#!/sbin/openrc-run +command="/usr/bin/salt-${fname}" +command_args="--daemon" +pidfile="/var/run/salt-${fname}.pid" +name="Salt ${fname} daemon" - # shellcheck disable=SC2181 - if [ $? -eq 0 ]; then - chmod +x "/etc/init.d/salt-$fname" - else - echoerror "Failed to get OpenRC init script for $OS_NAME from $script_url." - return 1 +depend() { + need localmount + use net + after bootmisc +} +_eof + chmod +x "$script_path" fi # Skip salt-api since the service should be opt-in and not necessarily started on boot