Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove run and kill commands from the runtime #3740

Merged
merged 3 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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