mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-03-17 06:43:01 +00:00
Unmask and re-enable services before restarting to ensure proper startup
This commit is contained in:
parent
b58e1d80ee
commit
bb98418ac9
@ -635,11 +635,16 @@ func (o *Orchestrator) restartServices() error {
|
|||||||
// Get services to restart
|
// Get services to restart
|
||||||
services := utils.GetProductionServices()
|
services := utils.GetProductionServices()
|
||||||
|
|
||||||
// Re-enable all services BEFORE restarting them.
|
// Unmask and re-enable all services BEFORE restarting them.
|
||||||
// orama node stop disables services, and orama-node's PartOf= dependency
|
// "orama node stop" masks services (symlinks unit to /dev/null) to prevent
|
||||||
// won't propagate restart to disabled services. We must re-enable first
|
// Restart=always from reviving them. We must unmask first, then re-enable,
|
||||||
// so that all services restart with the updated binary.
|
// so that all services (including namespace services) can actually start.
|
||||||
for _, svc := range services {
|
for _, svc := range services {
|
||||||
|
if masked, err := utils.IsServiceMasked(svc); err == nil && masked {
|
||||||
|
if err := exec.Command("systemctl", "unmask", svc).Run(); err != nil {
|
||||||
|
fmt.Printf(" ⚠️ Warning: Failed to unmask %s: %v\n", svc, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
if err := exec.Command("systemctl", "enable", svc).Run(); err != nil {
|
if err := exec.Command("systemctl", "enable", svc).Run(); err != nil {
|
||||||
fmt.Printf(" ⚠️ Warning: Failed to re-enable %s: %v\n", svc, err)
|
fmt.Printf(" ⚠️ Warning: Failed to re-enable %s: %v\n", svc, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user