procutils: add WaitZombieLoop

This commit is contained in:
Yousong Zhou
2021-04-20 19:27:24 +08:00
parent 519997fd52
commit a1044c1afc
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -28,6 +28,7 @@ import (
common_app "yunion.io/x/onecloud/pkg/cloudcommon/app"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func StartService() {
@@ -49,7 +50,7 @@ func StartService() {
db.EnsureAppInitSyncDB(app, dbOpts, models.InitDB)
defer cloudcommon.CloseDB()
go ReapZomebieLoop(context.TODO())
go procutils.WaitZombieLoop(context.TODO())
common_app.ServeForever(app, baseOpts)
}
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package service
package procutils
import (
"context"
@@ -28,7 +28,7 @@ import (
"yunion.io/x/log"
)
func ReapZomebieLoop(ctx context.Context) {
func WaitZombieLoop(ctx context.Context) {
myPid := os.Getpid()
if myPid != 1 {
log.Infof("My pid is not 1 and no need to wait zombies")