This commit is contained in:
A.Unger
2021-03-09 13:10:05 +01:00
parent 9284c232b8
commit 757cb9abe9
9 changed files with 162 additions and 127 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ func KillCommand(cfg *config.Config) *cli.Command {
},
&cli.StringFlag{
Name: "port",
Value: "10666",
Value: "6060",
EnvVars: []string{"OCIS_RUNTIME_PORT"},
Destination: &cfg.Runtime.Port,
},
+18 -8
View File
@@ -1,6 +1,11 @@
package command
import (
"fmt"
"log"
"net"
"net/rpc"
cli "github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis/pkg/config"
@@ -22,20 +27,25 @@ func RunCommand(cfg *config.Config) *cli.Command {
},
&cli.StringFlag{
Name: "port",
Value: "10666",
Value: "6060",
EnvVars: []string{"OCIS_RUNTIME_PORT"},
Destination: &cfg.Runtime.Port,
},
},
Action: func(c *cli.Context) error {
// TODO(refs) this implementation changes as we don't depend on os threads anymore.
//client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
//if err != nil {
// log.Fatal("dialing:", err)
//}
//
//res := runtime.RunService(client, os.Args[2])
//fmt.Println(res)
client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Hostname, cfg.Runtime.Port))
if err != nil {
log.Fatal("dialing:", err)
}
var reply int
if err := client.Call("Service.Start", "settings", &reply); err != nil {
log.Fatal(err)
}
fmt.Println(reply)
return nil
},
}