diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2025-08-25 20:25:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-25 20:25:17 +0200 |
| commit | de98f424116e77b9ec802db59d4c515cc6be144f (patch) | |
| tree | 9146e1a57da5f224c13fec60ba529174619a0bb0 /src/server/game/Scripting/ScriptDefines | |
| parent | 846efc3b6407b83da1b09eee78d1d94a654b219a (diff) | |
feat(Service Manager): add service registry custom dir and restore functionality (#22589)
This pull request introduces significant enhancements to the service management system by adding a service registry with features like automatic tracking, reboot persistence, and restoration of missing services.
The goal of this PR is to allow the user to store the service configuration files into an arbitrary directory, in this way they can be easily tracked, versioned, and replicated across different environments
It also includes a migration script to transition from the legacy service configuration format to the new registry-based system. Below is a summary of the most important changes:
### Service Registry and Management Enhancements:
1. **Service Registry Integration**:
- Added a comprehensive service registry system to track all created services, enabling features like cross-reboot persistence and restoration of missing services (`apps/startup-scripts/src/service-manager.sh`). [[1]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R41-R229) [[2]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R273)
- Introduced commands for managing the registry, such as `restore` for recreating missing services and `list` for viewing registered services. [[1]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R273) [[2]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R332-R334) [[3]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R346-L172)
2. **PM2 Persistence**:
- Enhanced PM2 integration to automatically configure startup persistence across reboots using `pm2 startup` and `pm2 save` after service creation.
### Migration and Compatibility:
3. **Migration Script**:
- Added a `migrate-registry.sh` script to convert legacy service configurations into the new registry format. It ensures compatibility while preserving existing service information (`apps/startup-scripts/src/migrate-registry.sh`).
### Documentation Updates:
4. **Updated README**:
- Expanded documentation in `README.md` to explain the new service registry features, including usage examples, custom configuration directories, and migration instructions. [[1]](diffhunk://#diff-0917b2888cc9b16539173f318b77773d08f7bf360579b68b9710a96ca2bcbb64L387-R468) [[2]](diffhunk://#diff-0917b2888cc9b16539173f318b77773d08f7bf360579b68b9710a96ca2bcbb64R613-R626)
### Configuration Improvements:
5. **Custom Configuration Directories**:
- Added support for overriding the default configuration directory for service registry and files using the `AC_SERVICE_CONFIG_DIR` environment variable. [[1]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9L14-R15) [[2]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R346-L172)
These changes significantly improve the usability, reliability, and maintainability of the service management system, especially for setups requiring persistence and multi-project configurations.
Diffstat (limited to 'src/server/game/Scripting/ScriptDefines')
0 files changed, 0 insertions, 0 deletions
