Skip to content
Open
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
23 changes: 15 additions & 8 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down