Skip to content

Commit

Permalink
Merge branch 'master' into fix_1
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Jan 31, 2024
2 parents 0b37fdf + c72f4e0 commit 64f389e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion embed/templates/systemd/system.service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LimitCORE={{.LimitCORE}}
LimitNOFILE=1000000
LimitSTACK=10485760

{{- if .GrantCapNetRaw}}
{{- if and .GrantCapNetRaw (eq .SystemdMode "system")}}
AmbientCapabilities=CAP_NET_RAW
{{- end}}
{{- if eq .SystemdMode "system"}}
Expand Down
8 changes: 5 additions & 3 deletions pkg/cluster/manager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ func buildScaleOutTask(
dirs = append(dirs, spec.Abs(globalOptions.User, dirname))
}
}

if systemdMode == spec.UserMode {
dirs = append(dirs, spec.Abs(globalOptions.User, ".config/systemd/user"))
}
t := task.NewBuilder(m.logger).
RootSSH(
instance.GetManageHost(),
Expand Down Expand Up @@ -434,7 +436,7 @@ type hostInfo struct {
func buildMonitoredDeployTask(
m *Manager,
uniqueHosts map[string]hostInfo, // host -> ssh-port, os, arch
noAgentHosts set.StringSet, // hosts that do not deploy monitor agents
noAgentHosts set.StringSet, // hosts that do not deploy monitor agents
globalOptions *spec.GlobalOptions,
monitoredOptions *spec.MonitoredOptions,
gOpt operator.Options,
Expand Down Expand Up @@ -508,7 +510,7 @@ func buildMonitoredCertificateTasks(
m *Manager,
name string,
uniqueHosts map[string]hostInfo, // host -> ssh-port, os, arch
noAgentHosts set.StringSet, // hosts that do not deploy monitor agents
noAgentHosts set.StringSet, // hosts that do not deploy monitor agents
globalOptions *spec.GlobalOptions,
monitoredOptions *spec.MonitoredOptions,
gOpt operator.Options,
Expand Down
4 changes: 3 additions & 1 deletion pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func (m *Manager) Deploy(
if strings.HasPrefix(globalOptions.DataDir, "/") {
dirs = append(dirs, globalOptions.DataDir)
}

if systemdMode == spec.UserMode {
dirs = append(dirs, spec.Abs(globalOptions.User, ".config/systemd/user"))
}
t := task.NewBuilder(m.logger).
RootSSH(
host,
Expand Down
3 changes: 0 additions & 3 deletions pkg/cluster/spec/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ func (i *BaseInstance) InitConfig(ctx context.Context, e ctxt.Executor, opt Glob
sudo := true
if opt.SystemdMode == UserMode {
systemdDir = "~/.config/systemd/user/"
if err := os.MkdirAll(systemdDir, os.ModePerm); err != nil {
return err
}
sudo = false
}
cmd := fmt.Sprintf("mv %s %s%s-%d.service", tgt, systemdDir, comp, port)
Expand Down

0 comments on commit 64f389e

Please sign in to comment.