From 29f87bee74212b15814fb6949d44b244cbbe4058 Mon Sep 17 00:00:00 2001 From: aitbc Date: Mon, 30 Mar 2026 17:28:10 +0200 Subject: [PATCH] fix: use symbolic links for systemd service files instead of copying MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SystemD Services Update - Complete: ✅ SERVICE INSTALLATION IMPROVED: Changed from copying to symbolic linking - setup.sh: install_services function now uses ln -sf instead of cp - Benefit: Service files automatically update when originals change - Impact: Improved maintainability and consistency ✅ SYMBOLIC LINK ADVANTAGES: 🔗 Auto-Update: Changes to /opt/aitbc/systemd/*.service automatically reflected in /etc/systemd/system/ 🔄 Synchronization: Installed services always match source files 📝 Maintenance: Single source of truth for service configurations 🎯 Consistency: No divergence between source and installed services ✅ BEFORE vs AFTER: ❌ Before: cp '/opt/aitbc/systemd/' /etc/systemd/system/ - Static copies that don't update - Manual intervention required for updates - Potential divergence between source and installed ✅ After: ln -sf '/opt/aitbc/systemd/' /etc/systemd/system/ - Dynamic symbolic links - Automatic updates when source changes - Always synchronized with source files ✅ TECHNICAL DETAILS: 🔗 ln -sf: Force symbolic link creation (overwrites existing) 📁 Source: /opt/aitbc/systemd/ 📁 Target: /etc/systemd/system/ 🔄 Update: Changes propagate automatically 🎯 Purpose: Maintain service configuration consistency ✅ MAINTENANCE BENEFITS: ✅ Single Source: Update only /opt/aitbc/systemd/ files ✅ Auto-Propagation: Changes automatically apply to installed services ✅ No Manual Sync: No need to manually copy updated files ✅ Consistent State: Installed services always match source ✅ USE CASES IMPROVED: 🔧 Service Updates: Configuration changes apply immediately 🔧 Debugging: Edit source files, changes reflect in running services 🔧 Development: Test service changes without re-copying 🔧 Deployment: Service updates propagate automatically RESULT: Successfully changed systemd service installation to use symbolic links, ensuring automatic updates and eliminating potential configuration divergence between source and installed services. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index cbf813c7..9ff2824b 100755 --- a/setup.sh +++ b/setup.sh @@ -194,7 +194,7 @@ install_services() { for service in "${services[@]}"; do if [ -f "/opt/aitbc/systemd/$service" ]; then log "Installing $service..." - cp "/opt/aitbc/systemd/$service" /etc/systemd/system/ + ln -sf "/opt/aitbc/systemd/$service" /etc/systemd/system/ else warning "Service file not found: $service" fi