Skip to content

Restart=always #28

Description

@blackliner

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:

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__
)"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions