Commit Graph

24 Commits

Author SHA1 Message Date
Yehonal
a05cc525f0 feat(Config): Implement configuration severity policy and logging mechanism (#23284) 2025-10-25 01:16:09 +02:00
Yehonal
4c3eab650c feat(apps/service-manager): Add logging output for service uptime checks (#23252) 2025-10-16 11:30:04 +02:00
Yehonal
cfc8678843 feat(bash): several chores to bash scripts: (#23250) 2025-10-15 02:10:14 +02:00
Yehonal
8d4fb5b4b4 fix(bash/service-manager): pipeline errors (#23210) 2025-10-13 01:37:41 +02:00
Yehonal
bca1cb7168 fix(ServiceManager): add sentinel to argument serialization in exec definition 2025-10-13 00:19:12 +02:00
Yehonal
2717104dc4 feat(ServiceManager): enhance path handling and add canonicalization function 2025-10-13 00:08:25 +02:00
Yehonal
9f732c8cea feat(Bash/ServiceManager): enhance path portability (#22982) 2025-10-12 22:28:22 +02:00
Yehonal
119af32649 feat(Scripts): Add health and console commands to service manager and corresponding tests (#22814) 2025-09-06 15:10:42 +02:00
Yehonal
de98f42411 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.
2025-08-25 20:25:17 +02:00
NoxMax
c7351be94a fix(bash): Exit simple-restarter script if shutdown is requested (#22617) 2025-08-06 08:48:48 +02:00
Yehonal
dbee211506 fix(bash/starter): enhance interactive mode handling (#22516)
This pull request updates the startup script in `apps/startup-scripts/src/starter` to improve handling of interactive and non-interactive modes, particularly when running under different session managers. 

### Improvements to interactive and non-interactive mode handling:

* Updated the condition to check if the application should run interactively by combining `AC_LAUNCHED_BY_PM2` and `AC_DISABLE_INTERACTIVE` environment variables. This ensures more accurate handling of interactive mode.


Fixes: https://github.com/azerothcore/azerothcore-wotlk/issues/22507
2025-07-27 13:50:20 +02:00
Yehonal
9fcacf7ea7 feat: improve session management and PM2 support in startup scripts (#22420)
New feature to manage service restart policies and refactors crash logging paths for better flexibility and clarity. The most significant changes include adding support for configurable restart policies (`on-failure` and `always`), updating documentation to reflect these changes, and improving crash path handling in multiple scripts.
2025-07-06 12:00:38 +02:00
Yehonal
9a837ee1f7 fix(bash): Improve session management and GDB handling in service scripts (#22418)
This pull request introduces several enhancements and fixes to the startup scripts for AzerothCore, focusing on improving service management, interactive mode handling, and script execution. The most important changes include adding support for non-interactive mode, enhancing systemd integration, and refactoring the starter script to handle binary paths and files more robustly.

### Enhancements to Service Management:
* **Non-Interactive Mode:** Added `AC_DISABLE_INTERACTIVE` environment variable to disable interactive prompts for services running without session managers (e.g., systemd/pm2). This prevents hanging during non-interactive execution. (`apps/startup-scripts/src/run-engine`, `apps/startup-scripts/src/service-manager.sh`) [[1]](diffhunk://#diff-1792abab64da981c71221890876ce832aab405f670f320f75b73b8788b1a4174R336-R349) [[2]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R724-R727)
* **Enhanced Systemd Integration:** Services using session managers like tmux/screen are automatically configured with `Type=forking` and appropriate `ExecStop` commands to terminate sessions gracefully. (`apps/startup-scripts/src/service-manager.sh`) [[1]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R401-R425) [[2]](diffhunk://#diff-31edfed7f73d0647a5fc96ce74c249e025e884cd1fe06621cb78eb4a381464f9R567-R578)

### Improvements to Script Execution:
* **Starter Script Refactor:** Updated the starter script to require both binary path and file name as parameters, improving clarity and error handling. (`apps/startup-scripts/src/starter`) [[1]](diffhunk://#diff-e92f132163ec1e49dc625eac9107c6841ae14e416aa35adec787dca5031dc631L6-R16) [[2]](diffhunk://#diff-e92f132163ec1e49dc625eac9107c6841ae14e416aa35adec787dca5031dc631L26-R44)
* **Temporary GDB File Management:** Enhanced handling of temporary GDB configuration files, ensuring proper cleanup after execution. (`apps/startup-scripts/src/starter`) [[1]](diffhunk://#diff-e92f132163ec1e49dc625eac9107c6841ae14e416aa35adec787dca5031dc631R68-R70) [[2]](diffhunk://#diff-e92f132163ec1e49dc625eac9107c6841ae14e416aa35adec787dca5031dc631R92-R141)

### Updates to Tests:
* **Test Adjustments:** Modified test cases to reflect the updated starter script parameter requirements and error messages. (`apps/startup-scripts/test/test_startup_scripts.bats`) [[1]](diffhunk://#diff-febbaeb294e50bdba0511ecad5d44b0c3f11ae92c79dd19dbd5f61d41a654278L26-R26) [[2]](diffhunk://#diff-febbaeb294e50bdba0511ecad5d44b0c3f11ae92c79dd19dbd5f61d41a654278L41-R49)
2025-07-05 23:02:04 +02:00
Yehonal
e1b2689c3a feat(bash): startup-scripts reworked + bash scripts workflow integration (#22401) 2025-07-01 15:35:54 +02:00
Jelle Meeus
4f23dbbb03 refactor(Apps/Startup): replace 'set logging on` command with 'set logging enabled on' (#20778)
refactor: replace deprecated 'set logging on'
2024-12-01 21:29:35 +01:00
Angelo Venturini
97dff23ba1 feat(apps/scripts): set a logging file for gdb using starter app (#16278) 2023-05-16 20:57:35 -03:00
UltraNix
9e3332dc20 feat(Apps): Imrpove crashlogs on Linux. (#9131)
Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
2021-11-11 16:23:03 +01:00
Yehonal
380f406248 Feat(Docker/bash): docker-compose system rework (#4488)
## ⚠️ATTENTION! ⚠️ Upgrading procedure:

**Database:** After this PR will be merged you need to backup your DB first (you can use the db-assembler or any mysql client to generate the dump) and restore it after.  The reason is that we use now docker named volumes instead of binded ones to improve performance.

**Conf & client data**: if you use the default configuration, both the etc and the data folder are now available inside the **/env/docker**. 

Finally, you can cleanup the /docker folder previously used by our system.

## Changes Proposed:

This PR will implement the [devcontainer ](https://code.visualstudio.com/docs/remote/containers) feature for VSCode. Allowing us to develop and debug directly within the container in the same way on all OSes.

* Implemented support for vscode dev-container feature by remote-extension suite
* Docker performance optimizations for MacOS and non-linux hosts
* Bash system improvements
* Implemented first command using Deno runtime environment (typescript) and [commander.js]
* Implemented wait mechanism for db_assembler
* Implemented db migration command
* possibility to run the authserver and worldserver with GDB using the integrated simple-restarter
* Implemented docker multi-stage mechanism to use one single Dockerfile for all the services
* client-data downloader now creates a placeholder to avoid downloading the same version of data files multiple times
* deployment of pre-compiled docker images on [docker hub](https://hub.docker.com/u/acore), you can test them [here](https://github.com/azerothcore/acore-docker)
2021-04-22 09:57:05 +02:00
Francesco Borzì
46d6a4690b fix(Bash/simple-restarter): always show the correct command name (#3996) 2020-12-22 15:54:57 +01:00
Francesco Borzì
ab72d3ce91 feat(Bash/restarter): add restarter to the available bin/ collection (#3991) 2020-12-15 12:59:18 +01:00
Yehonal
3fb937f003 Fixed simple-restarter script 2018-07-17 14:56:13 +00:00
Yehonal
af5256cd5b Various fixes to acore dashboard
+ simple restarter now prevents infinite crash loops
+ client data downloader now uses github releases and fixed downloading path
+ module updating now take care about compatibility version info
+ disabled CONFDIR variable in bash conf file, using BINPATH by default instead
2018-07-17 13:54:23 +02:00
Yehonal
85388901cf Rewrite of bash system
+ Implemented new dashboard menu
+ some fixes for db_assembler
+ new module installation process with version check via json files
+ some fixes to modules installer
+ implemented simple crossplatform worldserver and authserver restarters
+ new compiler script
+ client data downloader (beta)
+ various other fixes
2018-07-15 22:51:17 +02:00
Yehonal
f06f32849f Directory Structure [step 1]: moving files
working on #672

NOTE: This commit can't be compiled!!
2017-10-12 20:00:52 +02:00