diff --git a/pkg/ansibleserver/service/service.go b/pkg/ansibleserver/service/service.go index 67c89c615f..3901aa1811 100644 --- a/pkg/ansibleserver/service/service.go +++ b/pkg/ansibleserver/service/service.go @@ -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) } diff --git a/pkg/ansibleserver/service/zombie.go b/pkg/util/procutils/zombie.go similarity index 97% rename from pkg/ansibleserver/service/zombie.go rename to pkg/util/procutils/zombie.go index 224e054df6..7127c09a9d 100644 --- a/pkg/ansibleserver/service/zombie.go +++ b/pkg/util/procutils/zombie.go @@ -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")