Index: /branches/amp_4_0/init/README.md
===================================================================
--- /branches/amp_4_0/init/README.md	(revision 0)
+++ /branches/amp_4_0/init/README.md	(working copy)
@@ -0,0 +1,37 @@
+## AMP initialization
+
+### Service - backend.service
+
+#### Reload systemd:
+
+sudo systemctl daemon-reexec
+
+#### Enable and start the service:
+
+sudo systemctl enable --now backend.service
+
+#### Check service status:
+
+sudo systemctl status backend.service
+
+#### View log output:
+
+tail -f /var/log/array-backend.log
+
+### Service - cassh.service
+
+#### Reload systemd:
+
+sudo systemctl daemon-reexec
+
+#### Enable and start the service:
+
+sudo systemctl enable --now cassh.service
+
+#### Check service status:
+
+sudo systemctl status cassh.service
+
+#### View log output:
+
+tail -f /var/log/array-sshd.log
Index: /branches/amp_4_0/init/backend.service
===================================================================
--- /branches/amp_4_0/init/backend.service	(revision 2565)
+++ /branches/amp_4_0/init/backend.service	(working copy)
@@ -1,5 +1,5 @@
 [Unit]
-Description=Array Management Platform Console Daemon
+Description=Array Management Platform Daemon
 After=sendmail.service network.service
 Requires=sendmail.service
 
@@ -9,6 +9,10 @@
 ExecStartPre=/ca/bin/avxapps_startup.sh
 ExecStart=/ca/bin/backend
 KillMode=process
+Restart=on-failure
+RestartSec=5
+StandardOutput=append:/var/log/array-backend.log
+StandardError=append:/var/log/array-backend.log
 
 [Install]
 WantedBy=multi-user.target
Index: /branches/amp_4_0/init/cassh.service
===================================================================
--- /branches/amp_4_0/init/cassh.service	(revision 2565)
+++ /branches/amp_4_0/init/cassh.service	(working copy)
@@ -1,13 +1,16 @@
 [Unit]
-Description=CM SSHD service
+Description=CM SSHD Service
 After=network.service
 
 [Service]
 Type=forking
-PIDFile=/var/run/sshd.pid
 ExecStartPre=/ca/bin/cassh_init.sh
 ExecStart=/ca/bin/sshd -f /ca/etc/sshd_config
 KillMode=process
+Restart=on-failure
+RestartSec=5
+StandardOutput=append:/var/log/array-sshd.log
+StandardError=append:/var/log/array-sshd.log
 
 [Install]
-WantedBy=multi-user.target
\ No newline at end of file
+WantedBy=multi-user.target
Index: /branches/amp_4_0/platform/base-image/README.md
===================================================================
--- /branches/amp_4_0/platform/base-image/README.md	(revision 0)
+++ /branches/amp_4_0/platform/base-image/README.md	(working copy)
@@ -0,0 +1,24 @@
+## base-image directory contains the scripts to install the dependencies AMP base image.
+
+# Dependency Installer
+
+This project provides a primary script (`dependency_installer.sh`) located in `/opt` that automates the installation and configuration of various software components. The individual installation and configuration scripts are stored in `/opt/tools`.
+
+## Contents
+
+The following scripts are executed in order:
+
+1. `install_python.sh` – Installs Python
+2. `install_psql.sh` – Installs PostgreSQL
+3. `install_influx.sh` – Installs InfluxDB
+4. `install_telegraf.sh` – Installs Telegraf
+5. `install_elk.sh` – Installs the ELK stack (Elasticsearch, Logstash, Kibana)
+6. `configure_elk.sh` – Configures ELK stack
+7. `configure_psql.sh` – Configures PostgreSQL (users, access, etc.)
+
+## Usage
+
+### Step 1: Make the script executable
+
+```bash
+sudo chmod +x /opt/run_all.sh
Index: /branches/amp_4_0/platform/base-image/dependecy_installer.sh
===================================================================
--- /branches/amp_4_0/platform/base-image/dependecy_installer.sh	(revision 0)
+++ /branches/amp_4_0/platform/base-image/dependecy_installer.sh	(working copy)
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Directory where the individual install/config scripts are located
+SCRIPT_DIR="/opt/tools"
+
+# Installation scripts (executed first)
+INSTALL_SCRIPTS=(
+  "install_python.sh"
+  "install_psql.sh"
+  "install_influx.sh"
+  "install_telegraf.sh"
+  "install_elk.sh"
+)
+
+# Configuration scripts (executed after a delay)
+CONFIGURE_SCRIPTS=(
+  "configure_elk.sh"
+  "configure_psql.sh"
+)
+
+run_scripts() {
+  local scripts=("$@")
+  for script in "${scripts[@]}"; do
+    SCRIPT_PATH="$SCRIPT_DIR/$script"
+
+    echo "------------------------------------------------------------"
+    echo "Running $script..."
+
+    if [ -f "$SCRIPT_PATH" ]; then
+      chmod +x "$SCRIPT_PATH"
+      "$SCRIPT_PATH"
+      if [ $? -ne 0 ]; then
+        echo "❌ Error occurred while running $script. Exiting."
+        exit 1
+      else
+        echo "✅ Completed $script."
+      fi
+    else
+      echo "❌ Script $script not found in $SCRIPT_DIR!"
+      exit 1
+    fi
+  done
+}
+
+echo "🚀 Starting installation phase..."
+run_scripts "${INSTALL_SCRIPTS[@]}"
+
+echo "⏳ Waiting 15 seconds before configuration phase..."
+sleep 15
+
+echo "🔧 Starting configuration phase..."
+run_scripts "${CONFIGURE_SCRIPTS[@]}"
+
+echo "🎉 All scripts executed successfully."
Index: /branches/amp_4_0/platform/scripts/README.md
===================================================================
--- /branches/amp_4_0/platform/scripts/README.md	(revision 0)
+++ /branches/amp_4_0/platform/scripts/README.md	(working copy)
@@ -0,0 +1,2 @@
+### Script - system_startup.sh
+
Index: /branches/amp_4_0/platform/scripts/system_startup.sh
===================================================================
--- /branches/amp_4_0/platform/scripts/system_startup.sh	(revision 0)
+++ /branches/amp_4_0/platform/scripts/system_startup.sh	(working copy)
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# Log file
+LOG_FILE="/var/log/system_startup.log"
+
+# List of services to check
+services=("elasticsearch" "filebeat" "influxd" "influxdb" "kibana" "logstash" "metricbeat" "postgresql-17" "sshd" "telegraf")
+
+# Function to check if a service is installed
+is_service_installed() {
+    systemctl list-unit-files --type=service | grep -q "$1"
+}
+
+# Function to log messages to the log file
+log_message() {
+    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOG_FILE
+}
+
+# Function to check and start services
+check_and_start_service() {
+    service=$1
+
+    # Check if the service is installed
+    if is_service_installed "$service"; then
+        # Check if the service is running
+        if ! systemctl is-active --quiet "$service"; then
+            log_message "$service is not running. Starting $service..."
+            systemctl start "$service"
+            if systemctl is-active --quiet "$service"; then
+                log_message "$service started successfully."
+            else
+                log_message "Failed to start $service."
+            fi
+        else
+            log_message "$service is already running."
+        fi
+    else
+        log_message "$service is not installed. Skipping."
+    fi
+}
+
+# Main execution loop
+log_message "Service startup check started."
+
+# Loop through the services and check their status
+for service in "${services[@]}"; do
+    check_and_start_service "$service"
+done
+
+log_message "Service startup check completed."
+
+exit 0
Index: /branches/amp_4_0/platform/tools/configure_psql.sh
===================================================================
--- /branches/amp_4_0/platform/tools/configure_psql.sh	(revision 2565)
+++ /branches/amp_4_0/platform/tools/configure_psql.sh	(working copy)
@@ -8,5 +8,5 @@
 AN_USER_PASSWORD="Array@123$"
 
 # Import PSQL Tables for the AN provided database
-PGPASSWORD="$AN_USER_PASSWORD" psql -U "$AN_USER" -d "$AN_DB_NAME" -f ./init_db.sql
+PGPASSWORD="$AN_USER_PASSWORD" psql -U "$AN_USER" -d "$AN_DB_NAME" -f ./config/init_db.sql
 
Index: /branches/amp_4_0/platform/tools/install_psql.sh
===================================================================
--- /branches/amp_4_0/platform/tools/install_psql.sh	(revision 2565)
+++ /branches/amp_4_0/platform/tools/install_psql.sh	(working copy)
@@ -68,13 +68,20 @@
 execute "sed -i 's/^#\\?listen_addresses\\s*=.*/listen_addresses = '\''*'\''/' \"$CONF_FILE\""
 execute "sed -i 's/^#\\?password_encryption\\s*=.*/password_encryption = '\''scram-sha-256'\''/' \"$CONF_FILE\""
 
-# Update pg_hba.conf
+# Update pg_hba.conf to restrict external access
+# Ensure local connections use scram-sha-256
 execute "sed -i 's/^\(local\\s\\+all\\s\\+all\\s\\+\\).*$/\\1scram-sha-256/' \"$HBA_FILE\""
 execute "sed -i 's/^\(host\\s\\+all\\s\\+all\\s\\+127\\.0\\.0\\.1\\/32\\s\\+\\).*$/\\1scram-sha-256/' \"$HBA_FILE\""
 execute "sed -i 's/^\(host\\s\\+all\\s\\+all\\s\\+::1\\/128\\s\\+\\).*$/\\1scram-sha-256/' \"$HBA_FILE\""
 execute "sed -i 's/^\(local\\s\\+replication\\s\\+all\\s\\+\\).*$/\\1scram-sha-256/' \"$HBA_FILE\""
-grep -q "0.0.0.0/0" "$HBA_FILE" || echo "host    all             all             0.0.0.0/0               scram-sha-256" >> "$HBA_FILE"
-grep -q "::/0" "$HBA_FILE" || echo "host    all             all             ::/0                    scram-sha-256" >> "$HBA_FILE"
+
+# Disable external host access by commenting out lines for 0.0.0.0/0 and ::/0
+# This finds lines starting with 'host' and containing either 0.0.0.0/0 or ::/0 and prepends '#'
+execute "sed -i -E '/^host\\s+.*(0\\.0\\.0\\.0\\/0|::\\/0)/ s/^/#/' \"$HBA_FILE\""
+
+# Removed the grep/echo lines that added external access rules (0.0.0.0/0 and ::/0)
+# grep -q "0.0.0.0/0" "$HBA_FILE" || echo "host    all             all             0.0.0.0/0               scram-sha-256" >> "$HBA_FILE"
+# grep -q "::/0" "$HBA_FILE" || echo "host    all             all             ::/0                    scram-sha-256" >> "$HBA_FILE"
 
 # Enable and start PostgreSQL service
 execute "systemctl enable postgresql-${PG_VERSION}"
