Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added shell script to check & restart server #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Graeme-Smith
Copy link
Contributor

@Graeme-Smith Graeme-Smith commented Aug 8, 2023

Cron job scheduled shell script added which will periodically check the server & restart it if it is down. Also update development docs.


This change is Reviewable

@Graeme-Smith Graeme-Smith self-assigned this Aug 8, 2023
@Graeme-Smith Graeme-Smith requested a review from aledj2 August 8, 2023 14:53
Copy link

@aledj2 aledj2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the installation of this crontab into the deployment repo?

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @Graeme-Smith)


restart_server.sh line 8 at r1 (raw file):

# Command to restart the server (replace this with the actual command)
# TODO check the file path for this command on the server
RESTART_COMMAND="ansible-playbook -i graeme/deployment/inventories/production graeme/deployment/playbooks/basher.yml"

this needs updating?


restart_server.sh line 12 at r1 (raw file):

# Perform the HTTP request using curl & check for successful exit code
if ! curl --output /dev/null --silent --head --fail "$URL"; then
  logger "The BASHer server is not running. Attempting to restart..."

is this the correct way to write to the syslog?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants