Skip to content

Commit

Permalink
Merge pull request #3740 from wkloucek/remove-run-kill-runtime
Browse files Browse the repository at this point in the history
remove run and kill commands from the runtime
  • Loading branch information
wkloucek authored May 9, 2022
2 parents f2c8ea0 + 0453dba commit faa8183
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 224 deletions.
10 changes: 10 additions & 0 deletions changelog/unreleased/change-remove-runtime-kill-run-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Bugfix: Remove runtime kill and run commands

We've removed the kill and run commands from the oCIS runtime.
If these dynamic capabilities are needed, one should switch to a full fledged
supervisor and start oCIS as individual services.

If one wants to start a only a subset of services, this is still possible
by setting OCIS_RUN_EXTENSIONS.

https://github.com/owncloud/ocis/pull/3740
10 changes: 0 additions & 10 deletions docs/ocis/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ The list command prints all running oCIS extensions.
ocis list
{{< / highlight >}}

To stop a particular extension:
{{< highlight txt >}}
ocis kill web
{{< / highlight >}}

To start a particular extension:
{{< highlight txt >}}
ocis run web
{{< / highlight >}}

The version command prints the version of your installed oCIS.
{{< highlight txt >}}
ocis --version
Expand Down
55 changes: 0 additions & 55 deletions ocis/pkg/command/kill.go

This file was deleted.

56 changes: 0 additions & 56 deletions ocis/pkg/command/run.go

This file was deleted.

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 faa8183

Please sign in to comment.