StatusChecker-Enabling at Startup StatusChecker helps you montor and manage your network devices and servers. It is best to have this always running on your server. Michael Baggett StatusChecker can be added to launch at startup using these instructions, tested on RHEL 9.5. StatusChecker Enable StatusChecker to Autostart Create the file: /usr/local/bin/start-status-api.sh sudo nano /usr/local/bin/start-status-api.sh Add the following lines: #!/bin/bash # Start Status Checker # # Debugging set -x exec > /tmp/start-status-api.log 2>&1 # Set the working directory to the desired path cd /usr/share/nginx/status-api.cvad.unt.edu || { echo "Error: Failed to navigate to /usr/share/nginx/status-api.cvad.unt.edu" exit 1 } cd backend || { echo "Error: Failed to navigate to backend" exit 1 } # Bring up Docker containers with build and detach mode docker compose up --build -d || { echo "Error: Failed to start Docker containers" exit 1 } echo "Docker containers started successfully!" Set correct permissions and ownership sudo chmod +x /usr/local/bin/start-status-api.sh sudo chown root:root /usr/local/bin/start-status-api.sh Create systemd configuration sudo nano /etc/systemd/system/status-api.service Configure status-api.service Copy these lines into the systemd file: [Unit] Description=Start Status API Docker Service After=network.target [Service] ExecStart=/usr/local/bin/start-status-api.sh WorkingDirectory=/usr/share/nginx/status-api.cvad.unt.edu Restart=always User=root Group=root StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target Restart Daemon, Enable, and Start sudo systemctl daemon-reload sudo systemctl enable status-api.service sudo systemctl start status-api.service Done. Troubleshooting Check Status of status-api.service sudo systemctl status status-api.service View logs for status-api-service sudo journalctl -u status-api.service Stop status-api-service sudo systemctl stop status-api.service Disable status-api-service sudo systemctl disable status-api.service Check for Windows CRLF in file: file /usr/local/bin/start-status-api.sh Convert script to UNIX Line endings sudo dnf install -y dos2unix sudo dos2unix /usr/local/bin/start-status-api.sh