pass current environment down to the process

This commit is contained in:
Alex Unger
2020-07-01 19:39:51 +02:00
parent fe470629f3
commit 576c4a70cd
4 changed files with 14 additions and 6 deletions
+3 -2
View File
@@ -7,7 +7,8 @@ import (
"net/rpc"
"os"
"github.com/micro/cli/v2"
cli "github.com/micro/cli/v2"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
"github.com/refs/pman/pkg/process"
@@ -39,7 +40,7 @@ func RunCommand(cfg *config.Config) *cli.Command {
log.Fatal("dialing:", err)
}
proc := process.NewProcEntry(os.Args[2], []string{os.Args[2]}...)
proc := process.NewProcEntry(os.Args[2], os.Environ(), []string{os.Args[2]}...)
var res int
if err := client.Call("Service.Start", proc, &res); err != nil {
+4 -3
View File
@@ -4,9 +4,10 @@ import (
"fmt"
golog "log"
"net/rpc"
"os"
"time"
"github.com/micro/cli/v2"
cli "github.com/micro/cli/v2"
"github.com/micro/micro/v2/client/api"
"github.com/micro/micro/v2/client/web"
@@ -99,7 +100,7 @@ func (r *Runtime) Launch(services []string) {
OUT:
for _, v := range services {
args := process.NewProcEntry(v, []string{v}...)
args := process.NewProcEntry(v, os.Environ(), []string{v}...)
var reply int
if err := client.Call("Service.Start", args, &reply); err != nil {
@@ -114,7 +115,7 @@ OUT:
if len(services) >= len(Extensions) { // it will not run for ocis_simple builds.
time.Sleep(2 * time.Second)
for _, v := range dependants {
args := process.NewProcEntry(v, []string{v}...)
args := process.NewProcEntry(v, os.Environ(), []string{v}...)
var reply int
if err := client.Call("Service.Start", args, &reply); err != nil {