Files
vtl-appliance/dist/adastra-vtl-installer/scripts/clean-reboot-mhvtl.sh
Othman H. Suseno 01080498af feat: Major VTL System Upgrade (Auth, Monitoring, CLI, Installer)
- Web UI:
  - Added secure Authentication system (Login, 2 Roles: Admin/Viewer)
  - Added System Monitoring Dashboard (Health, Services, Power Mgmt)
  - Added User Management Interface (Create, Delete, Enable/Disable)
  - Added Device Mapping view in iSCSI tab (lsscsi output)
- Backend:
  - Implemented secure session management (auth.php)
  - Added power management APIs (restart/shutdown appliance)
  - Added device mapping API
- CLI:
  - Created global 'vtl' management tool
  - Added scripts for reliable startup (vtllibrary fix)
- Installer:
  - Updated install.sh with new dependencies (tgt, sudoers, permissions)
  - Included all new components in build-installer.sh
- Docs:
  - Consolidated documentation into docs/ folder
2025-12-09 18:15:36 +00:00

126 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
echo "=========================================="
echo "MHVTL Clean Reboot Script"
echo "=========================================="
echo ""
# Stop mhvtl service gracefully
echo "1. Stopping mhvtl service..."
systemctl stop mhvtl
sleep 2
# Kill any remaining processes
echo "2. Cleaning up processes..."
pkill -9 vtltape 2>/dev/null || true
pkill -9 vtllibrary 2>/dev/null || true
sleep 1
# Clear lock files
echo "3. Clearing lock files..."
rm -f /var/lock/mhvtl/mhvtl* 2>/dev/null || true
# Show current configuration
echo ""
echo "=========================================="
echo "Current Configuration:"
echo "=========================================="
echo ""
echo "Library:"
grep "^Library:" /etc/mhvtl/device.conf
echo ""
echo "Drives:"
grep "^Drive:" /etc/mhvtl/device.conf
echo ""
# Create verification script for after reboot
cat > /tmp/verify-mhvtl-after-reboot.sh << 'EOF'
#!/bin/bash
echo "=========================================="
echo "MHVTL Post-Reboot Verification"
echo "=========================================="
echo ""
echo "1. Checking mhvtl service status..."
systemctl status mhvtl --no-pager -l
echo ""
echo "2. Checking running processes..."
ps aux | grep -E "(vtltape|vtllibrary)" | grep -v grep
echo ""
echo "3. SCSI Devices (lsscsi -g):"
lsscsi -g
echo ""
echo "4. Detailed SCSI info (/proc/scsi/scsi):"
cat /proc/scsi/scsi
echo ""
echo "5. Verifying drive types..."
echo "Expected: All HP Ultrium 6-SCSI"
echo "Actual:"
lsscsi -g | grep tape | awk '{print $3, $4, $5}'
echo ""
# Check if all drives are HP
IBM_COUNT=$(lsscsi -g | grep tape | grep IBM | wc -l)
HP_COUNT=$(lsscsi -g | grep tape | grep HP | wc -l)
echo "=========================================="
echo "Verification Result:"
echo "=========================================="
echo "IBM drives found: $IBM_COUNT"
echo "HP drives found: $HP_COUNT"
echo ""
if [ $IBM_COUNT -eq 0 ] && [ $HP_COUNT -eq 4 ]; then
echo "✅ SUCCESS! All drives are HP Ultrium 6-SCSI"
echo "✅ Configuration is correct!"
else
echo "⚠️ WARNING: Drive types don't match expected configuration"
echo " Expected: 0 IBM, 4 HP"
echo " Found: $IBM_COUNT IBM, $HP_COUNT HP"
fi
echo ""
echo "=========================================="
echo "To access Web UI:"
echo "http://localhost/mhvtl-config/"
echo "=========================================="
EOF
chmod +x /tmp/verify-mhvtl-after-reboot.sh
echo "=========================================="
echo "Pre-Reboot Checklist:"
echo "=========================================="
echo "✅ mhvtl service stopped"
echo "✅ Processes cleaned up"
echo "✅ Lock files cleared"
echo "✅ Verification script created at /tmp/verify-mhvtl-after-reboot.sh"
echo ""
echo "=========================================="
echo "READY TO REBOOT"
echo "=========================================="
echo ""
echo "After reboot, run this command to verify:"
echo " sudo /tmp/verify-mhvtl-after-reboot.sh"
echo ""
echo "Or check manually:"
echo " lsscsi -g"
echo ""
echo "Rebooting in 5 seconds..."
echo "Press Ctrl+C to cancel"
echo ""
for i in 5 4 3 2 1; do
echo "$i..."
sleep 1
done
echo ""
echo "Rebooting now..."
reboot