Files
vtl-appliance/scripts/start-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

52 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
CONFIG_FILE="/etc/mhvtl/device.conf"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: Configuration file not found: $CONFIG_FILE"
exit 1
fi
echo "Starting mhvtl Virtual Tape Library..."
rm -f /var/lock/mhvtl/mhvtl* 2>/dev/null || true
modprobe mhvtl 2>/dev/null || echo "Note: Running in userspace mode (kernel module not available)"
sleep 1
DRIVE_NUMS=$(grep "^Drive:" "$CONFIG_FILE" | awk '{print $2}' | sort -u)
for drive in $DRIVE_NUMS; do
if ! pgrep -f "vtltape.*-q $drive" > /dev/null; then
echo "Starting vtltape for drive $drive..."
/usr/bin/vtltape -q $drive > /dev/null 2>&1 &
else
echo "vtltape for drive $drive is already running"
fi
done
sleep 2
LIBRARY_NUMS=$(grep "^Library:" "$CONFIG_FILE" | awk '{print $2}' | sort -u)
for library in $LIBRARY_NUMS; do
if ! pgrep -f "vtllibrary.*$library" > /dev/null; then
echo "Starting vtllibrary for library $library..."
/usr/bin/vtllibrary -q $library > /dev/null 2>&1 &
else
echo "vtllibrary for library $library is already running"
fi
done
# Wait for vtllibrary to initialize
sleep 2
RUNNING_DRIVES=$(pgrep -f "vtltape" | wc -l)
RUNNING_LIBS=$(pgrep -f "vtllibrary" | wc -l)
echo "mhvtl started: $RUNNING_DRIVES drives, $RUNNING_LIBS libraries"
exit 0