resources: svc: Add deactivating state

There seems to be a "deactivating" state that some services can reach.
Add this case, and switch the panic to an error.
This commit is contained in:
James Shubin
2018-03-09 17:04:30 -05:00
parent 173ccf6861
commit fdd698dade

View File

@@ -182,8 +182,10 @@ func (obj *SvcRes) Watch() error {
log.Printf("Svc[%s]->Reloading", svc)
case "failed":
log.Printf("Svc[%s]->Failed", svc)
case "deactivating":
log.Printf("Svc[%s]->Deactivating", svc)
default:
log.Fatalf("Unknown svc state: %s", event[svc].ActiveState)
return fmt.Errorf("Unknown svc state: %s", event[svc].ActiveState)
}
} else {
// svc stopped (and ActiveState is nil...)