-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I just had a few runners dying on me, because the workloads it ran caused an OOM. It appears that the service does not set a Restart policy. Can we use MR to set it, or do you know if the config.sh itself has support for it?
References:
- [self hosted linux] OOM does not trigger service restart actions/runner#3929
- I don't see a placeholder in the template
Possible workaround:
Use the same approach as in #23 to manually add lines to the unit file.
MR_CMD_SVC_PRE_START="$(cat <<-'__HEREDOC__'
echo "🚀 Running custom commands before starting runner service."
name="$(<mr.d/name)"
echo "🚀 Runner: $name | User: $USER | Dir: $PWD"
source <( sed -n "1,$(grep -n '^UNIT_PATH=' svc.sh | cut -d: -f1)p" svc.sh )
echo "🚀 UNIT_PATH: $UNIT_PATH"
sudo sed -i -e '/^\[Service\]/a Restart=always' "$UNIT_PATH"
sudo systemctl daemon-reload
echo "🚀 Updated unit file:"
cat "$UNIT_PATH"
__HEREDOC__
)"vbem
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested