-
Notifications
You must be signed in to change notification settings - Fork 2.9k
1panel v2 #10891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1panel v2 #10891
Conversation
Introduces a new function to determine the configuration file path for a service based on the system's service manager. Supports both default directory paths for empty service names and specific file paths for named services. Ensures compatibility with "systemd", "openrc", and "sysvinit", while gracefully handling unsupported service managers. Improves service management flexibility and error handling in multi-environment setups.
Replaces hardcoded systemd service file paths with dynamic retrieval using `controller.GetServicePath`, enhancing maintainability and flexibility of the snapshot creation process. Relates to optimization of systemd service file handling.
…arious systems Introduces `SelectInitScript` and `GetScriptName` functions to determine appropriate init script names based on the service manager type. Supports differences in file naming conventions across "systemd", "openrc", and "sysvinit" systems, including detection of specific configurations via file existence checks. Adds `os` package for file status validation. Enhances compatibility with multiple initialization systems.
Refactors the service file restoration process to dynamically determine service paths and names, enhancing compatibility with various Linux distributions' service management systems. Attempts to copy configuration files using service names first, falling back to init script names if necessary, increasing robustness and adaptability of the restore operation.
Introduces a dedicated backup directory for service scripts during snapshot creation, recovery, and rollback processes. Ensures proper backup and restoration of initialization scripts and service-related files for improved consistency and robustness. Refactors file operations to use dynamically resolved service paths, reducing hardcoded dependencies.
Replaces hardcoded service names and paths with dynamically retrieved values to enhance maintainability and flexibility. Adds checks for creating service script directories during backup and rollback to improve stability and compatibility. Optimizes the handling of service script copying and backup paths.
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
在调用 global.LOG.Debugf 前增加 nil 检查,避免当全局日志对象未初始化时程序崩溃。 此问题可能在程序启动早期或日志系统异常时触发,增加健壮性。 Fix nil check for global logger to prevent panic Adds a nil check before invoking global.LOG.Debugf to ensure the program does not panic if the global logger is uninitialized. This improves robustness, particularly during early application startup or in cases of logging system failures.
在多个构建目标中添加CGO_ENABLED=0环境变量配置, 确保在不同平台下进行静态链接编译, 提升二进制文件的可移植性和运行稳定性。
当 newName 为 "." 或空字符串时,直接将源目录中的内容复制到目标目录, 增加其应用的场景。
What this PR does / why we need it?
Summary of your change
Please indicate you've done the following: