Skip to content

Commit

Permalink
remove rpc side of kill and run commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed May 9, 2022
1 parent 53e26f8 commit 0453dba
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 103 deletions.
35 changes: 0 additions & 35 deletions ocis/pkg/runtime/cmd/kill.go

This file was deleted.

33 changes: 0 additions & 33 deletions ocis/pkg/runtime/cmd/run.go

This file was deleted.

35 changes: 0 additions & 35 deletions ocis/pkg/runtime/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,25 +274,6 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) {
}
}

// Start indicates the Service Controller to start a new supervised service as an OS thread.
func (s *Service) Start(name string, reply *int) error {
swap := deepcopy.Copy(s.cfg)
if _, ok := s.ServicesRegistry[name]; ok {
*reply = 0
s.serviceToken[name] = append(s.serviceToken[name], s.Supervisor.Add(s.ServicesRegistry[name](swap.(*ociscfg.Config))))
return nil
}

if _, ok := s.Delayed[name]; ok {
*reply = 0
s.serviceToken[name] = append(s.serviceToken[name], s.Supervisor.Add(s.Delayed[name](swap.(*ociscfg.Config))))
return nil
}

*reply = 0
return fmt.Errorf("cannot start service %s: unknown service", name)
}

// List running processes for the Service Controller.
func (s *Service) List(args struct{}, reply *string) error {
tableString := &strings.Builder{}
Expand All @@ -317,22 +298,6 @@ func (s *Service) List(args struct{}, reply *string) error {
return nil
}

// Kill a supervised process by subcommand name.
func (s *Service) Kill(name string, reply *int) error {
if len(s.serviceToken[name]) > 0 {
for i := range s.serviceToken[name] {
if err := s.Supervisor.RemoveAndWait(s.serviceToken[name][i], 5000*time.Millisecond); err != nil {
return err
}
}
delete(s.serviceToken, name)
} else {
return fmt.Errorf("service %s not found", name)
}

return nil
}

// trap blocks on halt channel. When the runtime is interrupted it
// signals the controller to stop any supervised process.
func trap(s *Service, halt chan os.Signal) {
Expand Down

0 comments on commit 0453dba

Please sign in to comment.